Emeldalaeticia / Python-HangMan-Project

This is the weekly project and It's a hangman game

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python-HangMan-Project

This is the weekly project and It's a hangman game The game starts by welcoming the user and selecting a random word from a list. The word is then printed as underscores to represent the hidden letters. A function print_hangman is defined to display the different stages of the hangman for each incorrect guess. Another function printWord is defined to print out the word with letters guessed correctly filled in, and empty spaces for letters not yet guessed. Another function printlines is defined to print out lines to cover up the word after each guess. The game continues until the user guesses the entire word or makes six incorrect guesses. The user is prompted to guess a letter, and the program checks if the letter is in the word. If the letter is in the word, it is added to the list of guessed letters, and the word is printed out again with the correct letters filled in. If the letter is not in the word, the hangman is displayed and the number of incorrect guesses increases. The game ends when the user has guessed the entire word or has made six incorrect guesses. The program then displays the word and ends the game

About

This is the weekly project and It's a hangman game

License:MIT License


Languages

Language:Python 100.0%