On Mar 5, 7:24 pm, Paul Rubin <http://[EMAIL PROTECTED]> wrote: > This genexp is better than a loop because it bails out immediately > if it finds an out-of-range x.
That's true: assuming that input is sequential. But if it's farily random (e.g., [10, 20, 12, 46, 202, 5, 102]), then you need a loop/ list comp. to check each index. Regards, Jordan -- http://mail.python.org/mailman/listinfo/python-list