What would be the right filter so l will contain [(7,10),(9,20)]
>>> l=[(0,5),(7,10),(9,20),(18,22)]
>>> l=filter(lambda x: x[0]>6 and x[1]<21, l)
>>> l
<filter object at 0x7fb2349829e8>
>>>
I'm getting a "filter object", rather than a list of the 2 middle tuples from the original list.
list(l)<-- it's lazily evaluatedlistin front of the lamba expression. stackoverflow.com/questions/12319025/filters-in-python