Created
June 26, 2016 15:19
-
-
Save rahulkp220/d80a00b83a54c443ff5d5e3a75d1a1ad to your computer and use it in GitHub Desktop.
This file contains 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 duplicate(function): | |
def wrapper(*args,**kwargs): | |
return 2*function(*args,**kwargs) | |
return wrapper | |
def formatting(lowerscase = False): | |
def formatting_real(function): | |
def wrapper(*args, **kwargs): | |
if lowerscase: | |
return function(*args,**kwargs).lower() | |
else: | |
return function(*args,**kwargs).upper() | |
return wrapper | |
return formatting_real | |
@duplicate | |
@formatting(lowerscase = False) | |
def hello_world(msg = None): | |
return msg | |
print hello_world("Hi there!!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment