ID EN
Built-in Functions

filter

Python 3.11

Construct an iterator from those elements of iterable for which function is true. iterable may be either a sequence, a container which supports iteration, or an iterator. If function is None, the identity function is assumed, that is, all elements of iterable that are false are removed.

Syntax

PYTHON
filter(function, iterable)

See Also

itertools.filterfalse()