Source Code:
(back to article)
nums = [1,2,3,4,5] squared_nums = map(lambda x: x**2, nums) print(list(squared_nums)) # prints [1, 4, 9, 16, 25]
Result:
Report an issue