Skip to content

Instantly share code, notes, and snippets.

@bruisedsamurai
Created July 19, 2022 10:21
Show Gist options
  • Save bruisedsamurai/8fca0bea00c0b86815a03279dabdf1c7 to your computer and use it in GitHub Desktop.
Save bruisedsamurai/8fca0bea00c0b86815a03279dabdf1c7 to your computer and use it in GitHub Desktop.
Replace input function with another function
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