Word sums
Sign in to test your solution.
def letter_value(letter):
"""
>>> letter_value('A')
1
>>> letter_value('j')
10
>>> letter_value('!')
0
"""
def word_value(word):
"""
>>> word_value('arm')
32
>>> word_value('BEND')
25
>>> word_value('elbow')
57
"""
def is_word_sum(word1, word2, word3):
"""
>>> is_word_sum('arm', 'BEND', 'elbow')
True
>>> is_word_sum('KING', 'chair', 'THRONE')
True
>>> is_word_sum('Monty', 'Python', 'SHRUBBERY')
False
"""
if __name__ == '__main__':
import doctest
doctest.testmod()
You can submit as many times as you like. Only your latest submission will be taken into account.
Sign in to test your solution.
Python sandbox
This window allows you to run Python code without installing a thing. The code you write here is not automatically submitted to Dodona.