Warning! It seems that you are using Dodona within another webpage, so not everything may work properly. Let your teacher know so that he can solve the problem by adjusting a setting in the learning environment. In the meantime, you can click this link to open Dodona in a new window.
Warning! The page was not fully loaded, probably because of a network issue. It could be that not all functionalities work as expected. Please try reloading the page.
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()