>http://docs.python.org/2/library/itertools.html#itertools.takewhile > >for item in takewhile(lambda x: x < 5, range(10)): > pass >> >> [People who avoid the 'break' by functionalizing an inner portion of the >> loop are just kidding themselves and making their own code worse, IMO. >> Takewhile from itertools also works, but that's clumsy and wordy as well.] >>