Here’s another simple game: **”Guess the Animal”**.
I love Python; it’s so easy and user-friendly.
### Game: **Guess the Animal**
In this game, the computer randomly picks an animal from a list, and the player has to guess what it is.
```python
import random
def guess_the_animal():
animals = [“cat”, “dog”, “elephant”, “giraffe”, “lion”, “tiger”, “zebra”, “monkey”]
# Randomly select an animal from the list
secret_animal = random.choice(animals)
print(“Welcome to ‘Guess the Animal’!”)
print(“I am thinking of an animal. Can you guess which one it is?”)
while True:
# Ask the player to make a guess
guess = input(“Enter your guess (or type ‘exit’ to quit): “).lower()
# Check if the player wants to quit
if guess == “exit”:
print(“Thanks for playing! Goodbye!”)
break
# Check if the player’s guess is correct
if guess == secret_animal:
print(f”Congratulations! You guessed the animal: {secret_animal}.”)
break
else:
print(“That’s not correct. Try again!”)
print()
# Start the game
guess_the_animal()
```
### How the Game Works:
1. The program selects a random animal from a list.
2. The player has to guess the animal by typing the name.
3. If the player guesses correctly, the program congratulates them, and the game ends.
4. If the guess is incorrect, the game continues until the player guesses correctly or types “exit” to quit.
### Example Output:
```
Welcome to ‘Guess the Animal’!
I am thinking of an animal. Can you guess which one it is?
Enter your guess (or type ‘exit’ to quit): lion
That’s not correct. Try again!
Enter your guess (or type ‘exit’ to quit): giraffe
Congratulations! You guessed the animal: giraffe.
```
This game helps players practice their guessing skills and is great for reinforcing basic input/output in Python!