filter()¶
Description¶
With filter() you can apply a conditional expression to a list and only keep elements where the filter return true.
Example¶
This filters out all the true values in the list evaluating to [false].
This removes elements smaller or equal to 2 from the list evaluating to [4, 3, 4].