Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First The Best Number Ever solution in Creative category for The Best Number Ever by Takafumi_Yamanobe
LOVENUM = {'a': 1, 'b': 2, 'c': 3,
'd': 4, 'e': 5, 'f': 6,
'g': 7, 'h': 8, 'i': 9,
'j': 10, 'k': 11, 'l': 12,
'm': 13, 'n': 14, 'o': 15,
'p': 16, 'q': 17, 'r': 18,
's': 19, 't': 20, 'u': 21,
'v': 22, 'w': 23, 'x': 24,
'y': 25, 'z': 26, ' ': 0,
}
def checkio():
text = "I LOVE PYTHON"
text_small = text.lower()
numtext = [ LOVENUM[text_small[i]] for i in range(len(text_small)) ]
print(sum(numtext))
return sum(numtext)
if __name__ == '__main__':
# These "asserts" using only for self-checking and not necessary for auto-testing
assert isinstance(checkio(), (int, float, complex))
print("Coding complete? Click 'Check' to earn cool rewards!")
Dec. 26, 2018
Comments: