A simple command-line word guessing game where players try to uncover a hidden word by guessing letters one at a time.
How to Run:
- Download or save the Python hangman.py file.
- Open your terminal or command prompt and use the
cdcommand to navigate to the directory where you have downloaded the file.cd path/to/your/directory - Execute the python script by running the following command.
python hangman.py
How to Play:
- The game selects a random hidden word from a predefined list and shows the user the hidden word represented by underscores (e.g. "_ _ _ _ _" for a 5-letter word)
- Guess one letter at a time by typing it in the terminal
- Correct guesses will reveal the letter in its position(s)
- You're allowed 8 incorrect guesses before losing
- Win by guessing all letters before using up your 8 incorrect attempts
Game Features:
- Random word selection using Python's
randommodule - Visual display of guessed letters and remaining attempts
- Case-insensitive input (both uppercase and lowercase letters accepted)
- Input validation to ensure only single letters are entered
Game Rules:
- Only one letter can be guessed at a time
- Repeated guesses don't count against you
- You win when all letters are revealed
- You lose after 8 incorrect guesses
Example Gameplay:
Image 1: Game Start with 1 correct guess ("o") and 1 incorrect guess ("b")

