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,
Because print is not a function.
print
But you can make print-wrapper, of course:
>>> def p(x): ... print x ... >>> l = [1, 2, 3, 4, 5] >>> l = map(p, l) 1 2 3 4 5