为什么这样返回none?
def calc_prod(lst):
def lazy_prod():
def f():
a=1
for i in lst:
a=a*i
return a
return lazy_prod
f = calc_prod([1, 2, 3, 4])
print f()
def calc_prod(lst):
def lazy_prod():
def f():
a=1
for i in lst:
a=a*i
return a
return lazy_prod
f = calc_prod([1, 2, 3, 4])
print f()
2019-03-21
举报