python--day1

Decorator: Do not modify the source code does not modify the invocation

+ + Higher order functions nested closure function

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()

 

Guess you like

Origin www.cnblogs.com/Alom/p/11620827.html