How To Code a Simple Hangman Game - Python Tutorial

preview_player
Показать описание
Python Tutorial for beginners that explains step by step how to code a hangman game in python. The game is kept quite simple but has all the functionalities a normal hangman game would have. I will live code and go through each line of code and explain how the game actually works. You can play the game over your CLI. You can also adapt your own version based on this python hangman tutorial.

If you want to learn how to become a great Software Engineer, Advance your Career, Learn Everything from Python to AWS head over to

For any thoughts, ideas, feedback or questions contact me at

Disclaimer:
All videos are for educational purposes and use them wisely. Any video might have inaccurate or outdated information. I give my best to research every topic thoroughly but please be aware that videos can contain mistakes.
Рекомендации по теме
Комментарии
Автор

Thank you for sharing your knowledge NovelTech Media.
Here's is the working code just in case someone wants the code.

import time

name = input("what is your name?")
print("Hello, " + name)
print(" ")
time.sleep(1)
print("Start Playing ...")
time.sleep(0.2)
word = "plane"
guesses = ""
turns = 10
while turns > 0:
failed = 0
for char in word:
if char in guesses:
print(char)
else:
print("_")
failed += 1
if failed == 0:
print("Yaaahhhh, You WON!")
break
guess = input("guess a character:")
guesses += guess

if guess not in word:
turns -= 1
print("You Guessed Wrong")
print("You have only", + turns, "left")

if turns == 0:
print("You loose")

haxxanagha
Автор

If you find this tutorial interesting and would like a more complex version of the game in a next video let me know in the comments

noveltechmedia
welcome to shbcf.ru