tkpmep at hotmail.com writes: > Or with a generator comprehension > n = sum ( y>x[i] for i in range(len(x)) ) - 1 > > But there has to be a cleaner way, as the first approach is unwieldy > and does not adapt to changing list lengths, and the second is not > obvious to a casual reader of the code. How about: n = len([y > t for t in x])