修饰器:不修改源代码,不修改调用方式
高阶函数+ 函数嵌套+闭包
def address(func):
def wanger():
add = "hangzhou"
age = "41"
minge = "man"
print(add,age,minge)
func()
return wanger
@address
def text():
name = "jsen"
print("You name is %s"%name)
text()
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did170858