What is a map() function in Python?

The map() function in Python is used for applying a function on all elements of a specified iterable. It consists of two parameters, function and iterable. The function is taken as an argument and then applied to all the elements of an iterable(passed as the second argument). An object list is returned as a result.

def add(n):
return n + n number= (15, 25, 35, 45)
res= map(add, num)
print(list(res))