定义:在嵌套函数内,使用(非本层变量)非全局变量就是闭包
def func(): a=1 def foo(): print(a) print(foo.__closure__) #判断是不是闭包,返回None就不是闭包 func()
作用: