In Python, how do you find the index of the first value greater than a threshold in a sorted list?
I can think of several ways of doing this (linear search, hand-wri
Related Index and Val of the last element greater than a threshold
l = [1, 4, 9, 16, 25, 36, 49, 64, 100, 81, 100] max((x,i) for i, x in enumerate(l) if x > 4) (100, 10)