For a normal function, map works well:
map
def increment(n): return n+1 l = [1, 2, 3, 4, 5] l = map(increment, l) print l >>> [2, 3, 4,
A better way to map print in 2.x would be to do
from __future__ import print_function