Question: Write a program that prompts the user to enter a three letter word using the following prompt: prompt = Please enter a three letter word:

Write a program that prompts the user to enter a three letter word using the following prompt:

prompt = "Please enter a three letter word: " 

Each letter in the word the user enters is assigned a score based on the position of the letter in the alphabet. The letter "a" would have a score of 1, the letter "b" would have a score of 2 and so on. The program calculates the total word score by summing the individual letter scores. The total is then printed. Some examples of the program being run are shown below.

Note the following:

  • You can assume that the user will always enter a string of length 3, where each character is an alphabetical character.
  • You will need to convert all the characters in the string to lowercase using the lower() string method.

For example:

Input Result
DoG
Please enter a three letter word: DoG The word DoG has a score of 26
CAt
Please enter a three letter word: CAt The word CAt has a score of 24

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!