Question: Instructions In Python, create a simple word guessing game where a player must guess a word, chosen at random from a pre-defined list of five
Instructions
In Python, create a simple word guessing game where a player must guess a word, chosen at random from a pre-defined list of five (5) possible words. The game should display a hint about the word once it is chosen. The player then has five (5) attempts to guess at letters in the word, with the game stating yes, the letter exists in the word or no, it does not. After a maximum of five guesses at letters, the player must attempt to guess the word. The player can also guess the word at any point by entering the keyword "guess". If the player guesses the correct word they win the game, otherwise they lose.
Specifically, your game must:
1. Randomly choose a word from a pre-defined list of five (5) possible words, unknown to the player. Sample list: ['cat', 'dog', 'five', 'dark', 'cloudy']
2. Display a hint about the chosen word (i.e. if the word is "cat", the game could say something like "Hint: Small four-legged friend known for their love of fish."
3. The player has five attempts to guess letters in the word.
4. The game should indicate whether the letter exists in the word or not (i.e. "Yes, there is at least one 'a' in the word")
5. After five attempts to guess letters, OR if the player enters the keyword guess, the player must guess the word
6. If the player guesses the correct word, the game should indicate they've won. Otherwise, the game should indicate they have lost, and state what the original word was.
7. Once the game ends, ask the player if they would like to play again. If yes, choose a new random word and start over. If no, terminate the program.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
