Hangman is a word game in which computer will randomly select a word from the dictionary and player has to guess it correctly in given number of turns. The word to be guessed is represented by row of stars. If the guessed letter is present is word, script will automatically be placed to correct places.
Rules to guess the word :
- Input single letter in one turn.
- Don’t use repeated letters.
- Turns will be decremented after every guess.
This is the text file used inside the code words.txt, which contains 50,000 English words.
Module needed :
Below is the implementation :
* * * * * Word has 5 letters Total turns: 11 Enter your guess: a Turns left 10 ********** Enter your guess: i Turns left 9 i **i**i**** Enter your guess: s Turns left 8 s **i**i**ss Enter your guess: r Turns left 7 **i**i**ss Enter your guess: h Turns left 6 **i**i**ss Enter your guess: e Turns left 5 e **i**i*ess Enter your guess: o Turns left 4 **i**i*ess Enter your guess: u Turns left 3 u *ui**i*ess Enter your guess: t Turns left 2 t *ui*ti*ess Enter your guess: n Turns left 1 n *ui*tiness Enter your guess: l Turns left 0 l *uiltiness Word is: guiltiness
- Hangman Game in Python
- Mastermind Game using Python
- 21 Number game in Python
- Python | Pokémon Training Game
- Color game using Tkinter in Python
- Number guessing game in Python
- Python | Catching the ball game
- Python program for word guessing game
- Conway's Game Of Life (Python Implementation)
- Python | Simple FLAMES game using Tkinter
- Python implementation of automatic Tic Tac Toe game using random number
- Introduction to pyglet library for game development in Python
- Python | Program to implement simple FLAMES game
- Number Guessing Game in Python using Binary Search
- Python | Program to implement Jumbled word game
- Python | Program to implement Rock paper scissor game
- 8-bit game using pygame
- PyQt5 - Snake Game
- PyQt5 - The Color Game
- PyQt5 – Jumble Word Game
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.