avatar Bite 3. Word Values

Calculate the dictionary word that would have the most value in Scrabble.

There are 3 tasks to complete for this Bite:

  • First write a function to read in the dictionary.txt file (= DICTIONARY constant), returning a list of words (note that the words are separated by new lines).
  • Second write a function that receives a word and calculates its value. Use the scores stored in LETTER_SCORES. Letters that are not in LETTER_SCORES should be omitted (= get a 0 score).
  • With these two pieces in place, write a third function that takes a list of words and returns the word with the highest value.

Look at the TESTS tab to see what your code needs to pass. Enjoy!

Login and get coding
go back Intermediate level
Bitecoin 3X

998 out of 1083 users completed this Bite.
Will you be Pythonista #999 to crack this Bite?
Resolution time: ~51 min. (avg. submissions of 5-240 min.)
Pythonistas rate this Bite 3.8 on a 1-10 difficulty scale.
» You can do it! 😌

We use Python 3.8