How to build Hangman Game in Python in Hindi | Word Guessing Game Python | Hangman Game Python 2021
How to build Hangman Game in Python in Hindi | Word Guessing Game Python | Hangman Game Python 2021
Note : Recplace (greater than) and (less than) with their sign/symbol ( Because Youtube donot allow angle brackets in description ) OR You can get this code on github by using github link
Code github Link : https://github.com/ubaidahmadceh/python_projects/blob/main/Hangman.py
code :
import random
word_list = ["india", "pakistan", "america"]
chosen_word = random.choice(word_list)
word_length = len(chosen_word)
display = []
for _ in range(word_length):
display += "_"
print(display)
lives = 8
game_over = False
while not game_over:
guess = input("Enter a guess : ").lower()
for position in range(word_length):
letter = chosen_word[position]
if letter == guess:
display[position] = letter
if guess not in chosen_word:
lives -= 1
if lives == 0:
game_over = True
print("You Lose")
print(display)
if "_" not in display:
game_over = True
print("Yow Win")
how to make a game using python,coding a game in python,hangman in python,making a game with python,hangman python,game made with python,hangman game,learn python,python hangman tutorial,word guessing game,simple python game,python hangman,using python to make a game,command line game,it training program,hangman,game development,it certification,programming basics for beginners,run python from command line,python,training courses,cbtnuggets,python game