import bisect
bisect.bisect_left([100,300,500,800,1000], p)
here the docs: bisect
More Related Contents:
- Search list for number in range
- What happens when start value < end value with range() cmd in Python?
- How to use a decimal range() step value?
- Identify groups of continuous numbers in a list
- What is the difference between range and xrange functions in Python 2.X?
- How to join two dataframes for which column values are within a certain range?
- Why does range(start, end) not include end?
- Should you always favor xrange() over range()?
- range() for floats
- Is it possible to implement a Python for range loop without an iterator variable?
- Python 3 turn range to a list
- `xrange(2**100)` -> OverflowError: long int too large to convert to int
- NameError: global name ‘xrange’ is not defined in Python 3
- converting a list of integers into range in python
- How to check if the current time is in range in python?
- How to loop backwards in python? [duplicate]
- Python range() and zip() object type
- How to find range overlap in python?
- How does the Python’s range function work?
- Python – Rounding by quarter-intervals
- Print a list in reverse order with range()?
- Range as dictionary key in Python
- Is there a need for range(len(a))?
- Python 3 range Vs Python 2 range
- Python IndexError: list index out of range
- Is it possible to make a `for` loop without an iterator variable? (How can I make make code loop a set number of times?)
- Does range() really create lists?
- Limiting user input to a range in Python
- Strange result when removing item from a list while iterating over it in Python
- How can the built-in range function take a single argument or three?