ID EN
Bisect

bisect_left

Python 3.11

Locate the insertion point for x in a to maintain sorted order. The parameters lo and hi may be used to specify a subset of the list which should be considered; by default the entire list is used. If x is already present in a, the insertion point will be before (to the left of) any existing entries. The return value is suitable for use as the first parameter to list.insert() assuming that a is already sorted.

Syntax

PYTHON
bisect.bisect_left(a, x, lo=0, hi=len(a), *, key=None)

See Also

key function