Discuss / Python / 交作业

交作业

Topic source

Sandamu

#1 Created at ... [Delete] [Delete and Lock User]
>>> def test():
...     def f(j):
...         return lambda:j * j
...     fs = []
...     for i in range(1, 4):
...         fs.append(f(i))
...     return fs
...

根据后一章节匿名函数lambda最后的返回函数写出来的


  • 1

Reply