请问为什么这段代码打印结果是‘’f是invalid syntax?‘’
def calc_sum(lst):
def lazy_sum():
return sum(lst)
return lazy_sum
f = calc_sum([1, 2, 3, 4])
print f
print f()
def calc_sum(lst):
def lazy_sum():
return sum(lst)
return lazy_sum
f = calc_sum([1, 2, 3, 4])
print f
print f()
2017-03-09
举报