This (filter) is similar to map() implementation.. how-ever when “filter()” is used, only the “TRUE” results on sequence items when it gone through function will be returned.. That said, the result is filtered based on “True” value of function return on sequence items.
Again syntax is similar to map() as discussed in previous post..
For ex:
>>>> l=[11,10,23,100]
>>> list(filter(lambda x: x%10 == 0, l))
[10, 100]
>>> list(filter(lambda x: x%10, l))
[11, 23]
>>>