Steven D'Aprano <steve at REMOVE.THIS.cybersource.com.au> writes: > or even > > len(filter(lambda t, y=y: y>t, x)) How about min(i for i,t in enumerate(x) if t >= y) or max(i for i,t in enumerate(x) if t <= y) Those are actually pretty direct.