i作用的详解
def count():
fs = []
for i in range(1, 4):
def f():
print(i)
return lambda : i*i
fs.append(f())
return fs
f1, f2, f3 = count()
print(f1(), f2(), f3())
输出:
==================== RESTART: D:/software/python/test.py ====================
1
2
3
9 9 9
>>>