This Hangman game is a Python implementation where the computer randomly selects a fruit from a predefined list, and the user tries to guess it one letter at a time. It's a simple and interactive way to play the classic word-guessing game.
No additional installation is required except for Python. This game can be run in any standard Python environment with the following command:
python3 milestone_5.py
To play the game, run the script. The game will choose a random fruit from the list, and you will be prompted to guess the fruit one letter at a time. After each guess, the game will inform you if your guessed letter is in the word or not.
- A random fruit is chosen by the computer from a predefined list.
- You are prompted to enter a single letter as your guess.
- The game will respond whether your guessed letter is in the word.
- Incorrect guesses reduce the number of lives.
- Keep guessing letters until you figure out the fruit or run out of lives.
please enter a single letter as a guess: a Good guess! a is in the word.
milestone_5.py
: The main Python script that contains the logic for the Hangman game.
This project is open-source and available under the MIT License.