Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
You can use the functions in the bisect module with a list slicing operator. For example bisect_left finds the index of the insertion point in a sorted list, and if the values are equal, it will fi...
Answer
#1: Initial revision
You can use the functions in the [`bisect`](https://docs.python.org/3/library/bisect.html) module with a list slicing operator. For example `bisect_left` finds the index of the insertion point in a sorted list, and if the values are equal, it will find the position to its left. ``` >>> l = [1, 3, 5, 6, 7, 8] >>> from bisect import bisect_left >>> bisect_left(l, 4) 2 >>> bisect_left(l, 5) 2 >>> l[bisect_left(l, 4):] [5, 6, 7, 8] >>> l[bisect_left(l, 5):] [5, 6, 7, 8] ```