Skip to content

Instantly share code, notes, and snippets.

@vinay13
Last active August 21, 2016 10:11
Show Gist options
  • Save vinay13/e1d7b56fa5a8d2847db13419956f6aed to your computer and use it in GitHub Desktop.
Save vinay13/e1d7b56fa5a8d2847db13419956f6aed to your computer and use it in GitHub Desktop.
#usr/bin/python
def currency(func):
def wrapper(*args,**kwargs):
return '$' + str(func(*args, **kwargs))
return wrapper
@currency
def price_with_tax(tax_rate_percentage):
price = 1000
return price * (1 - (tax_rate_percentage * .01))
print price_with_tax(30)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment