Describe
Answer
from functools import reduce
def mul(x,y):
return x*y
def prod(L):
return reduce(mul,L)
print(prod([3,5,7,9]))
Output
945
Process finished with exit code 0
from functools import reduce
def mul(x,y):
return x*y
def prod(L):
return reduce(mul,L)
print(prod([3,5,7,9]))
945
Process finished with exit code 0