def count(): fs = [] for i in range(1, 4): def f(): return i*i fs.append(f()) return fs
f1, f2, f3 = count()
这样就是1,4,9了
Sign in to make a reply
分享公元
def count(): fs = [] for i in range(1, 4): def f(): return i*i fs.append(f()) return fs
f1, f2, f3 = count()
这样就是1,4,9了