<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_random_word(dictionary, starting_letter=None):
 """ Takes the dictionary to read from and returns a random word optionally accepts a starting letter """

    if starting_letter is None:
        starting_letter = random.choice(list(dictionary.keys()))

    try:
        to_return = random.choice(dictionary[starting_letter])
    except KeyError:
        msg = "Dictionary does not contain a word starting with '{}'"
        raise NoWordForLetter(msg.format(starting_letter))

    return to_return