有两段代码不知道哪里不一样,报错为int' object is not callable
def b(list1):
sum=1
for i in list1:
sum=sum*i
return sum
def calc_prod(lst):
def fun():
return b(lst)
return fun()
f = calc_prod([1, 2, 3, 4])
print f()
def b(list1):
sum=1
for i in list1:
sum=sum*i
return sum
def calc_prod(lst):
def fun():
return b(lst)
return fun()
f = calc_prod([1, 2, 3, 4])
print f()
2019-02-22
举报