Created
February 14, 2016 20:05
-
-
Save pminkov/47adf92453687f9d529b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def square(func): | |
def inner(x): | |
r = func(x) | |
r = r * r | |
return r | |
return inner | |
def plus5(x): | |
return x + 5 | |
@square | |
def plus3(x): | |
return x + 3 | |
print plus5(3) | |
print plus3(2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment