fork download
  1. import bisect
  2. x = [1, 1, 2, 3, 5, 5, 8, 13]
  3. i = bisect.bisect_left(x, 5)
  4. print('i = {}'.format(i))
  5. j = bisect.bisect(x, 5)
  6. print('j = {}'.format(j))
  7.  
Success #stdin #stdout 0.02s 9216KB
stdin
Standard input is empty
stdout
i = 4
j = 6