def multiply(x):
return (x*x)
def add(x):
return (x+x)
funcs = [multiply, add]
for i in range(5):
value = list(map(lambda x: x(i), funcs))
print(value)
So I understand that map is used to apply a function/first arg to every item in the list/second arg. What I dont understand is how its being handled on this list of functions.
Output:
[0, 0]
[1, 2]
[4, 4]
[9, 6]
[16, 8]