- The
filter()allows you to filter items from an iterable based on evaluation of the given function. It applies function to each element of and returns an iterator that yields all items for which is truthy. Conversely, it filters out all items for which is falsy.
filter(<f>, <iterable>)