Scrabble Challenge

scrabbleThis 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.

Learning Objectives


By completing this challenge you will discover the difference between a list and a dictionary, two data structures that can be used in Python.

You may want to read more about [lists] and about {dictionaries} first.

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…

unlock-access

Solution...

The solution for this challenge is available to full members!
Find out how to become a member:
➤ Members' Area

Did you like this challenge?

Click on a star to rate it!

Average rating 3.3 / 5. Vote count: 3

No votes so far! Be the first to rate this post.

As you found this challenge interesting...

Follow us on social media!

Tagged with: ,