def func(): return [lambda x: x*i for i in range(5)]def foo(): return [m(2) for m in func()]res = foo()print(res)>>> [8, 8, 8, 8]
本文共 185 字,大约阅读时间需要 1 分钟。
def func(): return [lambda x: x*i for i in range(5)]def foo(): return [m(2) for m in func()]res = foo()print(res)>>> [8, 8, 8, 8]
转载于:https://www.cnblogs.com/KbMan/p/11192084.html