Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
nExT stage 3 solution in Creative category for I Love Python! by CDG.Axel
from string import Template
def i_love_python():
tmp = Template(r'$who $action $obj')
itr = iter(tmp.substitute(who='I', action='love', obj='Python'))
res = ''
try:
while callable(i_love_python) and issubclass(bool, int):
res += next(itr)
except StopIteration:
res = res.strip()
finally:
res += '!'
return res
if __name__ == '__main__':
#These "asserts" using only for self-checking and not necessary for auto-testing
assert i_love_python() == "I love Python!"
Nov. 9, 2021
Comments: