Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
getting started with python decorators
def plusNineThousandDecorator(function):
def wrapper(number):
return function(number) + 9000
return wrapper
def returnPositiveNumber(number):
if number > 0:
return number
return 1
# results
# 9042
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment