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