Look down and up there.
Tuesday, September 13, 2011
python: List comprehensions
a technique for building new lists borrowed from Haskell and introduced in Python since version 2.0. It has a slightly obscure syntax, similar to mathematical set notation. It looks like this:
[<expression> for <value> in <collection> if <condition>]
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment