How To Code Hangman In Python | Tutorial For Beginners

  Рет қаралды 51,836

Shaun Halverson

Shaun Halverson

Күн бұрын

Пікірлер: 46
@joniugvaro3977
@joniugvaro3977 2 жыл бұрын
maan this guy is soo underrated, he only has 1,55k subscribers and 3,3k views. he explained how to create hangman in 15 minutes and it was very understandable, if you listen and look carefully in the vid you will understand and write it without any mistakes and errors. keep up the good work
@fu2201
@fu2201 2 жыл бұрын
Shaun I love it. You get right to the point without trying to be some over the top personality or data dumping a lot of useless words. Great work. Efficient
@ekmeleker132
@ekmeleker132 2 жыл бұрын
bro, this was the best hangman video i have ever seen. this was exactly what i needed. keep up your work man!
@flarecreates3815
@flarecreates3815 Жыл бұрын
Shaun, your vids = the best. keep on going.
@enyaroels7560
@enyaroels7560 2 жыл бұрын
hey, i love the way how you made the game. but how do you have to code it when you find a letter in the middle of a word because i can only find the first letter and the second and so up. can you help me?
@TwelfthMan
@TwelfthMan Жыл бұрын
Hey i have a problem. It all seems to be going well until i actually get a letter right. the program thinks that i got wrong and adds a body part onto hangman, but still adds the letter into the word. I even tried copy and pasting your code from github and it still wouldnt work. I used a different compiler too. Why is this happening? edit: its because the use of current_guess_index is buggy, like another commenter said. It only works if you guess the first letter in the word. pretty big bug for a simple piece of code (relatively simple).
@hiddenthings4199
@hiddenthings4199 Жыл бұрын
How do we newbies fix it?
@Ghonzhalez
@Ghonzhalez Жыл бұрын
Have you already fixed?
@HaroldLavalley
@HaroldLavalley 11 ай бұрын
I fixed it. Remove the current_guess_index variable entirely and change the line that uses it "if(randomWord[current_guess_index] == letterGuessed):" to: "if letterGuessed in randomWord:". This will stop the program from caring which index in the randomWord youre dealing with and will simply check if letterGuessed is present in the word at all.
@kellyleigh4572
@kellyleigh4572 8 ай бұрын
​@@HaroldLavalley Thank you!! Never would have figured that out
@roeesun6758
@roeesun6758 8 ай бұрын
@@HaroldLavalley yeah seems like the position of the letter in the word doesnt matter, nice find
@Syriancoder
@Syriancoder Жыл бұрын
When i tried to run it, it ran how its supposed to, but wouldnt put the hangman signs when i get one wrong. and if i guess the word it does not say "game over thanks for playing". any help?
@supramur
@supramur 2 жыл бұрын
There are some questions i have. Like why do you need counter variable in printword() function? It doesn't do any job in this "for" cycle and you didn't returned it.
@darreneng2506
@darreneng2506 Жыл бұрын
Do you know if will it stills works if we remove the counter variable, increment and the [counter]?
@arturartur4747
@arturartur4747 2 жыл бұрын
cool video ! Literally save my python class > thanks
@ShaunHalverson
@ShaunHalverson 2 жыл бұрын
That’s awesome!
@ShaunHalverson
@ShaunHalverson 2 жыл бұрын
Thanks for watching :)
@seetsamolapo5600
@seetsamolapo5600 2 жыл бұрын
How did you create all this logic? Coming up with all these variable names? I'd like to see how you break up the problem, your pseudocode before you code, unless you code as you go
@ShaunHalverson
@ShaunHalverson 2 жыл бұрын
I normally code it ahead of time and then read off of it during the recording! Also, I try to use variable names that are fairly specific that way you don’t have to backtrack later and find out what it’s for
@ShaunHalverson
@ShaunHalverson 2 жыл бұрын
Great question!
@HannaBerhanu-dj4kz
@HannaBerhanu-dj4kz 6 ай бұрын
nice and very helpful!
@arturwyscioek899
@arturwyscioek899 2 жыл бұрын
The current_guess_index +=1 case is kinda buggy..... If user guessed a letter from the back/end of a random.word the hangman is wrote incorrectly though.... It only works correctly if we guess a letter +1 from the start
@jezzerthesnezzer2476
@jezzerthesnezzer2476 2 жыл бұрын
Have you found a way to fix this?
@arturwyscioek899
@arturwyscioek899 2 жыл бұрын
@@jezzerthesnezzer2476 I gave up on learnig this bruh :(
@jezzerthesnezzer2476
@jezzerthesnezzer2476 2 жыл бұрын
@@arturwyscioek899 Alright that’s fine just trying to figure this out for a school project.
@Centurio_Romae
@Centurio_Romae Жыл бұрын
@@jezzerthesnezzer2476 I am currently doing the same. Did you find a fix?
@HaroldLavalley
@HaroldLavalley 11 ай бұрын
I fixed it. Remove the current_guess_index variable entirely and change the line that uses it "if(randomWord[current_guess_index] == letterGuessed):" to: "if letterGuessed in randomWord:". This will stop the program from caring which index in the randomWord youre dealing with and will simply check if letterGuessed is present in the word at all
@tareqalfalah738
@tareqalfalah738 2 жыл бұрын
Hey man. I love your videos. I did everything in this video but when you try to play hangman it asks me to guess a letter over and over again. I do not know what’s going on. I did exactly what you did. Do you know what’s happening?
@SrijanReddy-c1w
@SrijanReddy-c1w 8 ай бұрын
you just saved my AP TEST SCORES THANK YOU
@alexanderclaxton2555
@alexanderclaxton2555 7 ай бұрын
hi I'm a beginner and had a doubt in the function print word, line 63 iits written print(randomword[counter]) i didn't get why we wrote counter as counter is a variable if someone could please help me out
@darrelldube5491
@darrelldube5491 Жыл бұрын
Please make a video for snake 😩😩. By the way your video's are so simple to understand. Thanks for making my coding journey so fun 😩😍
@yanzz9525
@yanzz9525 2 жыл бұрын
it just spams my console with "letters guessed so far: "
@kellyleigh4572
@kellyleigh4572 8 ай бұрын
How come when i guess the right letters it still adds body parts to the hangman
@RamcharanRathote-he2is
@RamcharanRathote-he2is Жыл бұрын
I love you bro This is awesome 👍 Please make more video
@Getincrazy
@Getincrazy 2 жыл бұрын
Say there is 6 letters already guessed. Any letter I guess after that always adds on a part of the hangman, even if the guess is right
@ShaunHalverson
@ShaunHalverson 2 жыл бұрын
Hmmm, can you compare your code with the stuff on Github? Or add me on Discord and I can try and assist.
@r-ty_dragon1334
@r-ty_dragon1334 Жыл бұрын
@@ShaunHalverson sorry if I’m late. I have the same problem. Have you found a fix yet? Thanks
@r-ty_dragon1334
@r-ty_dragon1334 Жыл бұрын
See my message above
@hiddenthings4199
@hiddenthings4199 Жыл бұрын
​@@r-ty_dragon1334 I'm trying to fix this problem too. No luck yet.
@deadmanwalking4459
@deadmanwalking4459 9 ай бұрын
didnt work. "just keeps saying letters guessed so far:"
@rileymchugh5316
@rileymchugh5316 Жыл бұрын
Did nobody realize that if you guess the letters out of order then you you lose one of your guesses even though that is right? that isnt how hangman works
@karmaakbane4184
@karmaakbane4184 2 жыл бұрын
Love your videos.. Hope u can help me modify my python project.. I did what i think is right but when i run it. Error everywhere....
@unixity_WasTaken
@unixity_WasTaken 2 жыл бұрын
ikr
@Helix404
@Helix404 Жыл бұрын
Source code by any chance??
@meghanandalman
@meghanandalman 7 ай бұрын
I’m a nerd😂😂😂😂😂😂😢😢😢😢😢
@donnykirr
@donnykirr Жыл бұрын
bro stop with the ads
Let's code a HANGMAN GAME in Python! 🕺
25:07
Bro Code
Рет қаралды 21 М.
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 651 М.
Арыстанның айқасы, Тәуіржанның шайқасы!
25:51
QosLike / ҚосЛайк / Косылайық
Рет қаралды 699 М.
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 37 МЛН
How to build HANGMAN with Python in 10 MINUTES
9:53
Kite
Рет қаралды 471 М.
Python for Beginners - Learn Coding with Python in 1 Hour
1:00:06
Programming with Mosh
Рет қаралды 19 МЛН
How to Build a Hangman Game with Python
16:34
CBT Nuggets
Рет қаралды 33 М.
I made Games with Python for 10 Years...
28:52
DaFluffyPotato
Рет қаралды 378 М.
How To Create Hangman Game in Python | Python Project Ideas
19:57
Using tkinter with classes
28:23
Atlas
Рет қаралды 73 М.
Learn Python With This ONE Project!
55:04
Tech With Tim
Рет қаралды 1,9 МЛН
Get Started in Pygame in 10 minutes!
10:19
Coding With Russ
Рет қаралды 384 М.
How I Would Learn To Code (If I Could Start Over)
13:43
Namanh Kapur
Рет қаралды 7 МЛН
10 Important Python Concepts In 20 Minutes
18:49
Indently
Рет қаралды 372 М.