from functools import reduce
def prod(L): def prod1(x,y): return x*y return reduce(prod1,L)
L=[3,5,7,9] print('3×5×7×9 =',prod(L))
Sign in to make a reply
sparkipp
from functools import reduce
def prod(L): def prod1(x,y): return x*y return reduce(prod1,L)
L=[3,5,7,9] print('3×5×7×9 =',prod(L))