Applies a function to every item of an iterable.
Syntax
map(function, iterable)Example
Enter values below to update the example in real time.
nums→doubled→list→map→lambda→print→nums = [1, 2, 3, 4, 5]
doubled = list(map(lambda x: x * 2, nums))
print(doubled) # [2, 4, 6, 8, 10]