l = [1, 2, 3, 4, 5] def foo(i): return i*i n = map(foo, l) print(list(n))
Print results
[1, 4, 9, 16, 25]