为什么f( )要用内部函数g( j ),我的代码为什么错了
def count():
fs = []
for i in range(1, 4):
def g(j):
return j*j
r = g(i)
fs.append(r)
return fs
f1, f2, f3 = count()
print f1(), f2(), f3()
def count():
fs = []
for i in range(1, 4):
def g(j):
return j*j
r = g(i)
fs.append(r)
return fs
f1, f2, f3 = count()
print f1(), f2(), f3()
2018-07-31
举报