from functools import reduce def prod(L): def f(x,h): y=x*h return y return reduce(f,L)
print('3 5 7 * 9 =', prod([3, 5, 7, 9]))
Sign in to make a reply
析瓜米米
from functools import reduce def prod(L): def f(x,h): y=x*h return y return reduce(f,L)
print('3 5 7 * 9 =', prod([3, 5, 7, 9]))