[Tutor] Fixing garbled email addresses
alan.gauld at btinternet.com
Tue May 1 17:03:03 CEST 2007
"Dotan Cohen" <dotancohen at gmail.com> wrote
> Does 'list comprehension' mean a detailed explanation of the code?
No its a programming construct found in Function programming
languages such as Haskell (Python is partially functional in nature).
Basically a list comprehension builds a list
lc = [item_expression for item in collection if item_test]
This is equivalent to
lc = 
for item in collection:
But it's shorter and usually faster.
See the functional programming topic of my web tutor for more
info and examples.
Author of the Learn to Program web site
More information about the Tutor