Map function returns the map object after applying the function on all the elements of the set of specified values stored in the iterables like list, tuple, etc.
Syntax:
Map (function, list or tuple)
Example:
# Return square of n
def addition(n):
return n*n
# We double all numbers using map()
numbers = (1, 2, 3, 4)
result = map(addition, numbers)
print(list(result))
Output:
[1, 4, 9, 16]
If you are looking for the certification course, you can check out this Python Certification by Intellipaat.
Also, watch this video on Python: