下面的程序是什么问题:
def count():
fs = []
k=0
for i in range(1, 4):
def f(j):
def g():
return j*j
return g
r=f(i)
k=r()
fs.append(k)
return fs
f1= count()
print f1()
解释结果:
Traceback (most recent call last):
File "index.py", line 15, in
print f1()
TypeError: 'int' object is not callable
慕盖茨4494581
相关分类