希望哪位大神来注释一下这个代码,有点懵逼
def calc_prod(lst):
def lazy_prod():
def f(x,y):
return x * y
return reduce(f,lst)
return lazy_prod
f = calc_prod([1, 2, 3, 4])
print f()
def calc_prod(lst):
def lazy_prod():
def f(x,y):
return x * y
return reduce(f,lst)
return lazy_prod
f = calc_prod([1, 2, 3, 4])
print f()
2019-12-08
举报