Skip to content

singadarsh790-cmyk/CodeAlpha_Python_hangman_game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Hangman Game

A simple Python command-line Hangman game built for CodeAlpha – Python Programming Internship (Task 1).

Author: Adarsh Singh

Goal

Create a simple text-based Hangman game where the player guesses a word one letter at a time.

How It Works

  • The game randomly picks a word from a small predefined list of 5 words.
  • The player guesses one letter at a time.
  • Correct letters are revealed in the word; incorrect guesses count against a limit of 6.
  • An ASCII art "hangman" gets drawn a bit more with each wrong guess.
  • The game ends when the player either guesses the full word (win) or makes 6 wrong guesses (lose).
  • After each game, the player can choose to play again.

Key Concepts Used

  • random module
  • while loops
  • if-else conditionals
  • Strings
  • Lists

How to Run

  1. Make sure you have Python 3 installed.
  2. Download hangman_game.py from this repo.
  3. Open a terminal in that folder and run:
    python hangman_game.py
    
  4. Type a single letter at each prompt to guess. Try to guess the word before you run out of guesses!

Files

  • hangman_game.py – main program

Part of the CodeAlpha Python Programming internship – Module 1, Task 1. Created by Adarsh Singh

About

A simple Python command-line Hangman game where the player guesses a word one letter at a time — built for the CodeAlpha Python Programming internship.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages