Files
python/pythonProject/闭包/1.py
T

10 lines
221 B
Python
Raw Normal View History

2026-05-18 16:13:55 +08:00
"""
闭包函数
函数内部调用了函数外部的局部变量,并且外部函数返回内部函数即为闭包函数
"""
def func1():
a = 1001
def func2():
return a
return func2
print(func1()())