为什么直接return就用不了了
def count():
fs = []
for i in range(1, 4):
def f(j):
return j*j
r = f(i)
fs.append(r)
return fs
f1, f2, f3 = count()
print f1(), f2(), f3()
少一个延迟计算为什么就得不出答案?不也是return j*j 吗
def count():
fs = []
for i in range(1, 4):
def f(j):
return j*j
r = f(i)
fs.append(r)
return fs
f1, f2, f3 = count()
print f1(), f2(), f3()
少一个延迟计算为什么就得不出答案?不也是return j*j 吗
2020-01-08
举报