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 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 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
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 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 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
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 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
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.
Step by step
Solved in 3 steps with 1 images
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,