List Comprehension
Submitted by Des on Thu, 08/23/2012 - 13:22
A way of making lists from lists
>>> [x for x in range(20) if x%2 == 0]
[0, 2, 4, 6, 8, 10, 12, 14, 16, 18]
>>>
A way of making lists from lists
>>> [x for x in range(20) if x%2 == 0]
[0, 2, 4, 6, 8, 10, 12, 14, 16, 18]
>>>