修饰器:不修改源代码,不修改调用方式 高阶函数+ 函数嵌套+闭包 def address(func): def wanger(): add = " hangzhou " age = " 41 " minge = " man " print (add,age,minge) func() return wanger@address def text(): name =
修饰器:不修改源代码,不修改调用方式
高阶函数+ 函数嵌套+闭包
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()