You are here : python_3Built-in Functionsfilter

filter() - Built-in Functions

Construct an iterator from those elements of iterable for which function
returns 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

filter(function, iterable)


Example


Output / Return Value


Limitations


Alternatives / See Also


Reference