Day 007 of the 100 Days of Python challenge builds a Dragon Ball themed Hangman game. The program chooses a character name, hides its letters, and gives the player six lives to reveal the word.
Project Overview
The project separates reusable assets into modules: hangman_words.py provides the word list, while hangman_art.py provides the logo, hangman drawings, and trophy. The main file imports those values and controls the game.
A random word is selected at the beginning. The display is rebuilt on every turn by checking each letter against the player’s correct guesses. Incorrect guesses are stored separately and reduce the lives counter.
for letter in chosen_word:
if letter == guess or letter in correct_letters:
display += letter
else:
display += " _ "
The game ends when the player discovers every letter or reaches zero lives. Repeated guesses are detected and rejected before they change the game state.
What This Project Teaches
Day 007 practices imports, modules, random selection, lists, while loops, for loops, Boolean flags, and tracking state across turns. It also demonstrates how separating content from game logic keeps the main program easier to read.
Running the Project
cd 100daysofpython/day007
python main.py
The supporting Python files in the same folder are required. View the Day 007 source code on GitHub.
