yet another list comprehension question

namekuseijin namekuseijin.nospam at gmail.com
Mon May 4 02:33:25 EDT 2009


 >>> ls = [(1,2), (3,4), (5, None), (6,7), (8, None)]
 >>> [(x,y) for (x,y) in ls if y]
[(1, 2), (3, 4), (6, 7)]




More information about the Python-list mailing list