a break for comprehensions

Tom Jenkins tjenkins at nospiced.ham.devis.com
Thu Jul 26 13:07:08 EDT 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.
> 
> ie.
> lst = [0,2,4,5,6]
> evens = [0,2,4]
> 

*sigh* yep missed that break

now-if-my-newsgroup-reader-only-had-python-syntax-highlighting-ly yours
Tom




More information about the Python-list mailing list