◐ Shell
clean mode source ↗

Python Language Tutorial => Filter

Syntax

  • filter(function, iterable)
  • itertools.ifilter(function, iterable)
  • future_builtins.filter(function, iterable)
  • itertools.ifilterfalse(function, iterable)
  • itertools.filterfalse(function, iterable)

Parameters

ParameterDetails
functioncallable that determines the condition or None then use the identity function for filtering (positional-only)
iterableiterable that will be filtered (positional-only)

Remarks