๐ŸŽฎ Hangman Game in Python

A simple and interactive command-line Hangman game built using Python. Test your vocabulary skills by guessing the hidden word before you run out of chances! ๐Ÿš€


๐Ÿ“Œ Overview

The Hangman Game is a beginner-friendly Python project that randomly selects a word from a predefined list and allows the player to guess it one letter at a time. The player has a limited number of attempts to reveal the complete word.


โœจ Features

โœ… Random word selection from a predefined list
โœ… Interactive command-line gameplay
โœ… Displays hidden letters using underscores (_)
โœ… Updates the word after every correct guess
โœ… Tracks remaining attempts
โœ… Win/Loss detection system
โœ… Beginner-friendly Python logic
โœ… Uses loops, conditions, lists, and string manipulation


๐Ÿ› ๏ธ Technologies Used

  • ๐Ÿ Python 3
  • ๐ŸŽฒ Random Module
  • ๐Ÿ’ป Command Line Interface (CLI)

๐Ÿ“‚ Project Structure

๐Ÿ“ฆ Hangman-Game
 โ”ฃ ๐Ÿ“œ Hangman_game.py
 โ”— ๐Ÿ“œ README.md

๐Ÿš€ How to Run the Project

1๏ธโƒฃ Clone the Repository

git clone https://github.com/missalishbadilawar-ops/Hangman-Game-CodeAlpha.git

2๏ธโƒฃ Navigate to the Project Folder

cd Hangman-Game

3๏ธโƒฃ Run the Program

python Hangman_game.py

๐ŸŽฏ Game Rules

๐Ÿ“Œ A random word is selected by the program.

๐Ÿ“Œ The player guesses one letter at a time.

๐Ÿ“Œ Correct guesses reveal the letter's position in the word.

๐Ÿ“Œ Incorrect guesses reduce the remaining turns.

๐Ÿ“Œ The player wins if all letters are guessed before turns run out.

๐Ÿ“Œ The player loses when all turns are exhausted.


๐Ÿ–ฅ๏ธ Example Gameplay

Welcome to Hangman!

Word to guess: _ _ _ _ _ _
Turns left: 6

Guess a letter: p

Good job! 'p' is in the word.

Word to guess: p _ _ _ _ _
Turns left: 6

๐Ÿง  Concepts Covered

  • ๐Ÿ”„ While Loops
  • ๐Ÿ”€ Random Selection
  • ๐Ÿ“‹ Lists
  • ๐Ÿ” String Operations
  • ๐ŸŽฏ Conditional Statements
  • ๐Ÿ“Š User Input Handling
  • ๐Ÿ”ข Iteration with Enumerate()

๐Ÿ“ˆ Future Improvements

  • ๐ŸŽจ Add ASCII Hangman Graphics
  • ๐Ÿ”Š Sound Effects
  • ๐Ÿ“š Multiple Difficulty Levels
  • ๐Ÿ† Score Tracking System
  • ๐Ÿ”ค Larger Word Database
  • ๐Ÿ’พ Save & Load Game Progress
  • ๐Ÿ–ฅ๏ธ GUI Version using Tkinter or PyQt

๐Ÿค Contribution

Contributions are welcome! ๐ŸŽ‰

  1. Fork the repository ๐Ÿด
  2. Create a new branch ๐ŸŒฟ
  3. Commit your changes ๐Ÿ’พ
  4. Push to your branch ๐Ÿš€
  5. Open a Pull Request ๐Ÿ”ฅ

๐Ÿž Known Limitations

โš ๏ธ Duplicate letter validation is not yet implemented.

โš ๏ธ Only a small predefined word list is available.

โš ๏ธ Single-player mode only.


๐Ÿ‘จโ€๐Ÿ’ป Developer:

_ALISHBA DILAWAR -

_

โญInternship

This project was build during the CodeAlpha Python Programming virtual internship


๐ŸŽ‰ Happy Coding & Enjoy Playing Hangman! ๐ŸŽฎ

Built With

Share this project:

Updates