map, filter, reduce
Functional programming often involves passing functions to functions.
Here's Pythonic code running on items = [1, 2, 3, 4, 5]
:
sum_sq_odds = sum(x**2 for x in items if x % 2 == 1)
Written in a functional style:
sum_sq_odds = functools.reduce(
lambda x, y: x + y, filter(lambda x: x % 2 == 1, map(lambda x: x**2, items))
)