End of Summer - hours only!Up to 80% off on all courses and bundles.-Close
Scrabble Time

Instruction

Great job! You're almost there!

Exercise

Create a function called find_max_valued_words() that takes a list of words and letter_values as inputs and returns a set of words that have the greatest value with these letter values.

Stuck? Here's a hint!

First, create a dictionary of values from your word list. You can do this by calling create_word_value_dict() and saving the result to a variable. Second, find the maximum value from that dictionary. You can either use the function:

def find_greatest_value(elements_list):
  greatest_value = elements_list[0]
  for element in elements_list:
    if element > greatest_value:
      greatest_value = element
  return greatest_value

or you can use the max() function to get the max value from the dictionary values.

Finally, iterate over the keys and values of the word-value dictionary, compare the value of each key to the maximum found value, and append this to the new dictionary.