为什么我用python3.0写不出来这个
from functools import reduce
def calcprod(lst):
def prod(x,y):
return(x*y)
def p():
return(reduce(prod,lst))
return (p)
f = calcprod([1, 2, 3, 4])
print(f)
from functools import reduce
def calcprod(lst):
def prod(x,y):
return(x*y)
def p():
return(reduce(prod,lst))
return (p)
f = calcprod([1, 2, 3, 4])
print(f)
2016-06-29
举报