Iteration Classes

itertools.filterfalse()

Yield elements for which the predicate is false. None uses the truth value of each item.

Formal Syntax & Structure

python syntaxpython
itertools.filterfalse(predicate, iterable, /)

Parameters & Attributes

NameTypeDescription
predicatecallable or NonePredicate; None uses the input value itself.
iterableiterableInput values, consumed as needed.

Return Value

iterator

The iterator result described above.

Working Example

Example Snippetpython
import itertoolsprint(list(itertools.filterfalse(lambda x:x%2,range(5))))
Python Reference