This challenge consists of creating a computer program that displays a random selection of 7 letters to the end-user. Each letter is given a value based on the values used in the game of Scrabble.
The user is then asked to enter a word made up using the given letters used in any order.
The program should check that the word given by the end user consists of the right letters and then calculate the score of the word based on the letter used and their values.
For instance the word “CODING” would give a score of 3 + 1 + 2 + 1 + 1 + 2 = 10
Note that for this challenge we assume that the user will give a valid English word! We will not expect the computer to check that the word actually exists in the English Language.
By completing this challenge you will discover the difference between a list and a dictionary, two data structures that can be used in Python.
Complete the code
We have started the code for you. As you can see this code uses a list called randomLetters to store the value of the 7 randomly picked letters.
It also uses a dictionary called letterValues to store the value of each letter of the alphabet (Based on the game of Scrabble).
You now need to complete this code to finish the game…