Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
decorator solution in Creative category for I Love Python! by Sim0000
def love(func):
def wrapper():
return "I love {}!".format(func())
return wrapper
@love
def i_love_python():
return "Python"
if __name__ == '__main__':
#These "asserts" using only for self-checking and not necessary for auto-testing
assert i_love_python() == "I love Python!"
Aug. 21, 2014