Loading...
Use map, filter, and reduce to process data.
Python provides functional programming tools:
Write a function process_numbers(numbers) that applies various higher-order functions.
Return a dictionary with:
[1, 2, 3, 4, 5]
{'doubled': [2, 4, 6, 8, 10], 'evens': [2, 4], 'product': 120, 'sum_of_squares': 55}map(lambda x: x2), filter(lambda x: x%2==0), reduce(lambda a,b: ab)