1 def foo(test):
2 def foo1()
3 print("hello word!")
4 print(test = test+1)
5 return foo1
6
7 f1 = foo()
闭包:函数中还有定义的函数,并且里面的函数要用到外面函数的参数
最新推荐文章于 2024-05-01 09:21:10 发布
1 def foo(test):
2 def foo1()
3 print("hello word!")
4 print(test = test+1)
5 return foo1
6
7 f1 = foo()