1
Home
Tirsvad edited this page 2026-11-15 09:35:11 +01:00

English · Dansk · Bahasa Melayu

Hangman

A beginner-friendly Hangman game for the terminal.

What is it?

Day 7 of the Udemy course 100 Days of Code: The Complete Python Pro Bootcamp. The program picks a random word, shows it as blanks and lets the player guess one letter at a time until the word is complete or the lives run out.

What the exercise teaches

  • Using loops and conditions to drive a game
  • Working with lists and strings
  • Keeping the game logic apart from the input and output
  • Writing small automated tests

What it does

  • A random word and a row of blanks
  • Six lives, with an ASCII-art gallows that grows with every wrong guess
  • A friendly message for a letter that was already guessed
  • Input validation: only a single letter is accepted

Next