当一个嵌套函数在其外部区域引用了一个值时,该嵌套函数就是一个闭包,其意义就是会记录这个值 def out(x): def inside(): print(x) return inside() out(3) 相关文章: 2021-11-08 2021-11-22