Python Language Functional Programming in Python Filter Function

30% OFF - 9th Anniversary discount on Entity Framework Extensions until December 15 with code: ZZZANNIVERSARY9

Example

Filter takes a function and a collection. It returns a collection of every item for which the function returned True.

arr=[1,2,3,4,5,6]
[i for i in filter(lambda x:x>4,arr)]    # outputs[5,6]


Got any Python Language Question?