package for map in python code example
Example 1: map in python
'''try this instead of defining a function'''
a = [1,2,3,4]
a = list(map(lambda n: n+n, a))
print(a)
Example 2: python map
map(function_to_apply, list_of_inputs)
'''try this instead of defining a function'''
a = [1,2,3,4]
a = list(map(lambda n: n+n, a))
print(a)
map(function_to_apply, list_of_inputs)