Functional functions
•
map, filter, reduce, and zip are used in a functional
programming style
>>> map(str, [1,2,3,4])
[‘1’, ‘2’, ‘3’, ‘4’]
>>> zip([1,2,3], “abc”)
[(1, ‘a’), (2, ‘b’), (3, ‘c’)]
•
Great fun, but
list comprehensions
are even more fun