Last active
August 21, 2016 10:11
-
-
Save vinay13/e1d7b56fa5a8d2847db13419956f6aed to your computer and use it in GitHub Desktop.
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
#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