use of map() in python code example
Example 1: map in python
map(function_to_apply, list_of_inputs)
Example 2: map in python
>>> numbers = [1, 2, 3, 4, 5]
>>> squared = []
>>> for num in numbers:
... squared.append(num ** 2)
...
>>> squared
[1, 4, 9, 16, 25]