why do we put a function without parenthesis inside map, filter and reduce functions? Check the code below
def func(n):
return n**2
print(list(map(func,[1,2,3,4,5,6,7]))) # Here in this line of code func is placed inside map function without parenthesis. Why it is not put in this way map(func(),[1,2,3,4,5,6,7])?
Output:
[1, 4, 9, 16, 25, 36, 49]