Python filter(contintion,data) iterator filters data based on condition.
filter(contintion,data)
>>> from itertools import * >>> data = [2,6,9,3,1,5] >>> x = filter(lambda x: x%2, data) >>> for i in x: print (i)
9 3 1 5