Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
index map & string sum solution in Clear category for I Love Python! by shenghanteng
def i_love_python():
"""
Easy to start and funny to play!
"""
code='09001215220500162520081514'
ulc=[1,0,0,0,0,0,0,1,0,0,0,0,0]
abc=' abcdefghijklmnopqrstuvwxyz'
ans=''.join(map(lambda i,j: i.upper() if j==1 else i,[abc[int(code[2*i:2*i+2])] for i in range(len(code)//2)],ulc))+'!'
return ans
if __name__ == '__main__':
#These "asserts" using only for self-checking and not necessary for auto-testing
assert i_love_python() == "I love Python!"
June 7, 2018