Created
July 19, 2022 10:21
-
-
Save bruisedsamurai/8fca0bea00c0b86815a03279dabdf1c7 to your computer and use it in GitHub Desktop.
Replace input function with another function
This file contains hidden or 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 decorator(func): | |
return add | |
def add(a, b): | |
return a+b | |
def multiply(a, b): | |
return a*b | |
multiply = decorator(multiply) | |
print(multiply(8,8)) #16 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment