Newer posts are loading.
You are at the newest post.
Click here to check if anything new just came in.

March 08 2010

rogeriopvl

Answer by rogeriopvl for In Python, can I single line a for loop over iterator with an IF filter?

Using list comprehension (only if airports is a list of objects):

for airport in [a for a in airports if a.is_important]: