Loop in list.

Caleb Hattingh caleb.hattingh at gmail.com
Wed Feb 9 01:46:34 EST 2005


Hi Fredrik

*sigh*  I think I will stop writing mini-tutorials :)

You are, of course, correct.  And I really like your method of
explaining how to mentally juggle the LC into explicit loops.

I shudder to think how mnay people I confused with my incorrect
examples - I really should have tested them first.

Thanks again
Caleb

> (to translate a list comprehension to nested statements, remove
> the result expression, insert colons and newlines between the for/if
> statement parts, and put the append(result expression) part inside
> the innermost statement)
> 
> </F>




More information about the Python-list mailing list