In this lesson, you’ll see how to use
filter(). The built-in function
filter() is another classic functional construct and can be converted into a list comprehension.
It takes a predicate as a first argument and an iterable as a second argument. It builds an iterator containing all the elements of the initial collection that satisfies the predicate function.