import bisectx = [1, 1, 2, 3, 5, 5, 8, 13]i = bisect.bisect_left(x, 5)print('i = {}'.format(i))j = bisect.bisect(x, 5)print('j = {}'.format(j))
Standard input is empty
i = 4 j = 6
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!