How to Code a Game of Hangman... The EASY Way!! (Beginner Python Tutorial)

preview_player
Показать описание
One of the most common introductory Python projects is to code a game of Hangman. Almost all of MIT's introductory coding classes require you successfully program this fun little game.

Want to learn Python if you are an absolute beginner? Check out my in-depth beginner series:

In this video, I show you how to program a game of hangman that you can play on your computer. I randomly select a word from a list of words then continuously ask for user input until you win. Then, I show you how to incorporate lives so you can't get unlimited guesses.

**NOTE: in the words function, you should add a ".upper()" to "return word" so that everything is uppercased

Thanks for watching everyone!
~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~
Tags: hangman, python, python tutorial, how to code, how to code in python, beginner python programming tutorial, beginner python project, how to code in python for beginners, python programming for beginners, code games in python beginner, basic python tutorial, intro to python tutorial, introductory python lesson, python hangman tutorial, easy python hangman tutorial
~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~
Music:
Track: Alan Walker - Fade [NCS Release]
Music provided by NoCopyrightSounds.
Рекомендации по теме
Комментарии
Автор

**NOTE: in the words function, you should add a ".upper()" to "return word" so that everything is uppercased

Update: lol i'm thinking about redoing this video. comment below if you think that's a good idea



KylieYYing
Автор

Great tutorial. You carefully explain each step and why you're doing it. Perfect for a beginner. Unfortunately, a lot of "beginner" tutorials just race through and write lots of code and don't take time to pause and explain what's happening and why which is exactly what a tutorial is supposed to do.

leeroy
Автор

Thanks so much! As a beginner, it took me way longer than 10 mins to fully understand the logic. But, once it clicked, it all made sense! :D

Jan_Jan_
Автор

First: thank you very much. second - i'm beginner python program, so i try again to code hangman program or start from beginning. i'm also old man 63/yrs old, i never program my life, but i never give up, because it helps me to be active. thank you very much.

lijoso
Автор

Thank you for this. This is exactly what I needed to see. I am doing intro to Python at Uni and we have a test in a few days. They gave us a practice test which is based on Hangman and yours pretty much covers the parameters of the practice. So I will use this to help me study up for the test.

emyrdaniela
Автор

watch ton of video teach by mit people and all i know is that you all has super clarity fo teaching something and simple!

nimanizky
Автор

i love the logic on how u approached the game. will try it

kapach
Автор

Thanks Kylie for your great, easy-to-understand lesson for beginners like me. To make it a bit easier, I added 'Hint' option. It was fun :)

jitendrachhetri
Автор

Really like your teaching style. I will check out more of your videos.

mrgintl
Автор

Love the way you clearly explain what each line of code does. Great for beginners like me.

arjun_sanjeev
Автор

Ben here Kylie. Sorry, worked out my problem...Forgot to end the routine with a closing function..hangman()..All good and keep up the good work.

ben-zzrm
Автор

at 6:04 i run the code and even keep hangman() at the end of the code but nothing appears on my output. I ran it on pycharm and python idle. same result

divinejojolola
Автор

Hello!please I am having challenges with the code.The dashes in a word are printing alright but the guessed letters are not printing even though it is in the word.I have crosschecked several times but I can't find the error

thelmalaryea
Автор

the best tutorial i have found till now very helpful in understanding

tigressshah
Автор

can change lives to
lives = len(word_letters) + 2
so that it has 2 more tries than the unique letters that are in the word

footballizlyfe
Автор

nice little project... i'm crash learning python for a personal project and as I'm an old time programmer in old languages :) I discover the nice features described here in python dealing with strings when doing (alphabets - used_letters) 😊 I"m not used to have everything ready for me while rather thinking all the time I need to add it myself to the code. just need to know what's avail to make use of...

hadireg
Автор

I'd love to see a tutorial on how to make an advanced game of Hangman

kathleenbeltran
Автор

On line 22 you write: if user_letter in alphabet - used_letters:
What alphabet - used_letters means?
I understand user_letter in alphabet or alphabeth in user_letters. But both together, I`m not sure I understand.

ViniciusRaphael
Автор

I've literally copied basically everything but it still doesn't run properly. All I get is after entering a letter it says 'process finished with exit code 0'. There's no 'current word' or 'used letters' or anything and it doesn't loop.

bismo
Автор

8:30 There is a problem, on line 33 you are trying to find a capital letter within a set of lowercase letters.

guersomfalcon
welcome to shbcf.ru