为什么最后一行改成f 就对了,f()就报错,请大神指点,谢谢
def calc_prod(lst):
# def b():
def a(x,y):
return x*y
return reduce(a,lst,1)
# return b
f = calc_prod([1, 2, 3, 4])
print f
def calc_prod(lst):
# def b():
def a(x,y):
return x*y
return reduce(a,lst,1)
# return b
f = calc_prod([1, 2, 3, 4])
print f
2019-04-16
举报