Next / Previous / Contents / TCC Help System / NM Tech homepage

13.21. map(): Apply a function to each element of a sequence

Given a function f that takes one argument and returns a value, this function applies f to each element of a sequence S, and returns a new list containing the results of each of those function applications.

>>> def add100(x):
...     return x+100
... 
>>> map(add100, (44,22,66))
[144, 122, 166]