Write a python program that allows a user to guess if certain letters are in a word. The program should do the following: 1. Ask for the user to input a letter to guess. 2. Check if the input is valid. Valid input is a single letter or ‘quit’, both case insensitive 3. Output how many times that letter appears in the word (see example below). 4. The program should continue functionality 1 - 3 infinitely until the user enters ‘quit’. When the user enters ‘quit’, the word should be displayed, and the program should end.
Write a python program that allows a user to guess if certain letters are in a word. The program should do the following: 1. Ask for the user to input a letter to guess. 2. Check if the input is valid. Valid input is a single letter or ‘quit’, both case insensitive 3. Output how many times that letter appears in the word (see example below). 4. The program should continue functionality 1 - 3 infinitely until the user enters ‘quit’. When the user enters ‘quit’, the word should be displayed, and the program should end.
Chapter4: Making Decisions
Section: Chapter Questions
Problem 7E: Write a program named GuessingGame that generates a random number between 1 and 10. (In other words,...
Related questions
Question
Write a python program that allows a user to guess if certain letters are in a word. The program should do the following:
1. Ask for the user to input a letter to guess.
2. Check if the input is valid. Valid input is a single letter or ‘quit’, both case insensitive
3. Output how many times that letter appears in the word (see example below).
4. The program should continue functionality 1 - 3 infinitely until the user enters ‘quit’. When the user enters ‘quit’, the word should be displayed, and the program should end.
Example:
Enter a letter to guess: A
there are 1 a’s
Enter a letter to guess: 2
Invalid input
Enter a letter to guess: e
there are 0 e’s
Enter a letter to guess: quit
The word was ‘wombat’
Goodbye
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
Recommended textbooks for you
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,