filter
No overview available.
def filter(
function: callable,
iterable: iterable
) - > iterator
Filters a sequence of elements by applying a predicate function to each item and retaining only those that evaluate to true.
Parameters
| Name | Type | Description |
|---|---|---|
| function | callable | A function that accepts an item and returns a boolean; if null, the identity function is used. |
| iterable | iterable | The sequence of elements to be filtered. |
Returns
| Type | Description |
|---|---|
iterator | An iterator yielding the items from the original sequence for which the function returned true. |