a break for comprehensions
tjenkins at nospiced.ham.devis.com
Thu Jul 26 19:07:08 CEST 2001
Nick Perkins wrote:
> This misses the point of the original post.
> Notice the 'break' in the original for-loop version.
> The idea is to return consecutive elements,
> up to, but not including, the first element which
> does not meet the condition.
> lst = [0,2,4,5,6]
> evens = [0,2,4]
*sigh* yep missed that break
More information about the Python-list