Map, Filter and Reduce

Map, Filter, and Reduce are all functions in the Python Standard Library that can be used to manipulate lists. They are all defined in the functools module.

Map applies a function to every element in a list. For example:

image

Filter returns a list of elements for which a function returns True. For example:

image

Reduce applies a function to the elements of a list in a cumulative way. For example:

image

Ref https://medium.com/@jahaidul.islam358/map-filter-and-reduce-6e833a7737d3