您的位置: 首页 > IT文章 > 闭包:函数中还有定义的函数,并且里面的函数要用到外面函数的参数 闭包:函数中还有定义的函数,并且里面的函数要用到外面函数的参数 分类: IT文章 • 2025-01-21 19:04:37 1 def foo(test): 2 def foo1() 3 print("hello word!") 4 print(test = test+1) 5 return foo1 6 7 f1 = foo()