Professional Documents
Culture Documents
Compare and Contrast The Map
Compare and Contrast The Map
'Map' applies a given function to each item of an iterable (like a list or set)
and returns a list of the results. 'Filter' constructs a list from elements of an
iterable for which a function returns true. 'Reduce' applies a rolling
computation to sequential pairs of values in a list and returns a single result.
1. What's the important of using these three functions? (map, filter, and reduce).
Map/filter/reduce can often make code shorter and simpler and allow the
programmer to focus on the heart of the computation rather than on the
details of loops, branches, and control flow.
2. Describe the lambda function and what are the benefits of using lambda.
Johaira.Isra@msumain.edu.ph