Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke

4th Edition

0136086535, 9780136086536

More Books

Students also viewed these Databases questions

Question

Provide examples of Dimensional Tables.

Answered: 1 week ago