List comprehension confusion...

Erik Max Francis max at alcyone.com
Sat Feb 1 22:24:40 EST 2003


Afanasiy wrote:

> I am confused about the purpose of list comprehensions.
> What can they do which an explicit for loop cannot?

Nothing.  But, if used properly, they can be more compact and even more
readable.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ A man cannot be comfortable without his own approval.
\__/ Mark Twain
    Sade Deluxe / http://www.sadedeluxe.com/
 The ultimate Sade encyclopedia.




More information about the Python-list mailing list