**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 For more coding ideas, projects, and tutorials, be sure to subscribe! --> kzbin.info ~~~~~~~~~~~~~~~~~~~~~~~~ Source code: github.com/kying18/hangman ~~~~~~~~~~~~~~~~~~~~~~~~ Follow me on Instagram: instagram.com/kylieyying Follow me on Twitter: twitter.com/kylieyying
@hi-hi-here4 жыл бұрын
I think you should re-do it because next time you can be more proficient and specific, which is always something beginners need. And if you can also show how to play the game again without having to re-run the program.
@laughing-out-loudhd9963 жыл бұрын
Like ya alot !..
@lahocoschimocotaesdesteusj5593 жыл бұрын
@@laughing-out-loudhd996 bruhhhhhhhh
@farahmohumad53553 жыл бұрын
thanks for upload
@faisalkhan_093 жыл бұрын
It throw error Cannkt import name words from word
@leeroy774 жыл бұрын
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.
@KylieYYing4 жыл бұрын
Thank you :)
@Steven-ez6qp6 ай бұрын
@@KylieYYingHi ❤️ Hangman Such a fun game! I play Hangman with my niece and let her win and she 🤭🤣 and says yaaa I got to Hang a bad guy lol Soo funny and cute wouldn't you agree with me?
@Jan_Jan_3 жыл бұрын
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
@lijoso25734 жыл бұрын
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.
@KylieYYing4 жыл бұрын
That's amazing! Hangman is actually a pretty difficult project when you're a complete beginner. I would recommend watching my beginner series and following the beginner tutorials i have on there first: kzbin.info/aero/PLkWv3oO4kHnuKi032yRRYgyQ4kgaNp6gs
@emyrdaniela60374 жыл бұрын
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.
@KylieYYing4 жыл бұрын
Glad I could help! :) You should also check out my tic-tac-toe tutorial. It might help with figuring out logic, especially if you’re trying to code games!
@emyrdaniela60374 жыл бұрын
Y Cubed Guess what next weeks practical is? Tic tac toe haha. I’m subscribing. Thank you! We did a simple logic simulator last week and that was head gymnastics for me.
@KylieYYing4 жыл бұрын
Emry Daniels haha perfect! You can even step it up a notch because my tic tac toe implementation includes a simple algorithm that can make it unbeatable!
@nimanizky4 жыл бұрын
watch ton of video teach by mit people and all i know is that you all has super clarity fo teaching something and simple!
@kapach10004 жыл бұрын
i love the logic on how u approached the game. will try it
@arjun_sanjeev4 жыл бұрын
Love the way you clearly explain what each line of code does. Great for beginners like me.
@jitendrachhetri1473 жыл бұрын
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 :)
@mrgintl4 жыл бұрын
Really like your teaching style. I will check out more of your videos.
@tigressshah89042 жыл бұрын
the best tutorial i have found till now very helpful in understanding
@divinejojolola66322 жыл бұрын
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
@Pranav6.6265 ай бұрын
same here
@kathleenbeltran42104 жыл бұрын
I'd love to see a tutorial on how to make an advanced game of Hangman
@ben-zz2rm2 жыл бұрын
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.
@hadireg3 жыл бұрын
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...
@medalikhaled3 жыл бұрын
your tutorials are just fun to watch, you deserve more than 10k
@KylieYYing3 жыл бұрын
Thanks :) I’m trying hahaha
@footballizlyfe3 жыл бұрын
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
@guersomfalcon75444 жыл бұрын
8:30 There is a problem, on line 33 you are trying to find a capital letter within a set of lowercase letters.
@KylieYYing4 жыл бұрын
Yes, I realized that. If you look in the description I actually make a note of that. Sorry, my mistake!
@ViniciusRaphael4 жыл бұрын
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.
@KylieYYing4 жыл бұрын
You can think of alphabet - used_letters as a literal subtraction! It’s all the letters in the alphabet minus the used letters (so basically all the unused letters). We can do this because both of these are sets; it’s the difference of the sets. Hope that clears things up!
@ViniciusRaphael4 жыл бұрын
First of all thank you for answering. Now that you explained makes total sense. Btw thanks for the video, I`m learning Python and having the opportunity to check the logic on the process helped me a lot.
@KylieYYing4 жыл бұрын
No problem! I’m going to make more tutorials in the future :) You should subscribe and check them out!
@thelmalaryea57234 жыл бұрын
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
@KylieYYing4 жыл бұрын
Is it a lowercase uppercase issue?
@thelmalaryea57234 жыл бұрын
@@KylieYYing No please because the upper case is working
@lijoso25734 жыл бұрын
Hey: i get invalid syntax (if user_letter in alphabet - used_letters:) line 33
@swapnitam3 жыл бұрын
The video was great and very helpful as I am a beginner. I am using IDLE to write and run the script. When i run the module nothing happens. After searching I added following lines that helped me to run the script: def main(): hangman() if __name__ == "__main__": main() Can you tell me how it runs for you without this? What am I missing?
@kristencallan80962 жыл бұрын
I had that same issue and had to look at her linked source code. That was the only way it worked for me.
@mathsmagician69494 жыл бұрын
I have a question. How could I integrate levels(easy = 10 lives, medium = 8 lives and hard =6) and the actual hangman phases like the one you draw?
@KylieYYing4 жыл бұрын
You could pass these in and then adjust the lives accordifnly
@hanhtooaein6368 Жыл бұрын
What's the function of 'alphabet' variable in this hangman game?
@_thesunflowerfairy_3 жыл бұрын
You have taught me way more than my teacher has
@bananaboydan36422 жыл бұрын
5:05 how does the minus sign indicate whether you used the word or not?
@bananaboydan36422 жыл бұрын
please help im stuck
@alexwu71114 жыл бұрын
hey I'm a beginner! This tutorial is the best one I have ever seen before. I literily understood what you said on this video! Is awesome! I wish I can make a game like you. :))
@KylieYYing4 жыл бұрын
Yay happy to hear that!
@lahocoschimocotaesdesteusj5593 жыл бұрын
bruhhhhhhhhhh
@lazarorojas27424 жыл бұрын
Hi, i have a question on the line 33, what does do this symbol "-" or just - , as i can see it works as a logical operator "and". Please, tell if i am wrong.Good video though, i've already click the button like.
@KylieYYing4 жыл бұрын
No, so you can think of that as like sept subtraction. It’s alphabet minus used letters (ie unused letters)
@lazarorojas27424 жыл бұрын
@@KylieYYing Oh, thank you so much. i'm new on this so i get confused when i saw that.
@FA-sy7ew2 жыл бұрын
How does the code match the position(index) of the letters?
@bismo52684 жыл бұрын
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.
@arjunmauji63794 жыл бұрын
did you call the function at the end of your program ---> hangman()
@kulsumkhan82833 жыл бұрын
Hi Kylie. I am new to Python. Your tutorial is really easy to follow and is very clear and concise. Unfortunately I'm slightly struggling as my code is not running properly. I have followed exactly how you have done it. But I keep getting problem: Shadows name 'words' from outer space. I don't understand why that's happening when it worked fine on your. Could you please suggest me how to fix it. Thank you.
@glowria_balla43322 жыл бұрын
Having same issue
@simbian43453 жыл бұрын
5:00 What is that ' - ' do?
@charlie66184 жыл бұрын
0:26 was that veni johanna?
@galaxyfan78834 жыл бұрын
Hi, I couldn’t open it on my macbook’s terminal and played it from here. How can I open my files in terminal?
@Aabhusan72 жыл бұрын
#help In 22 line we can use (not in) instead of (-) right?
@ItachiUchihaJoker3 жыл бұрын
Great tutorial! But I have a question. So let's say you do not want to import the list (with words), but want to paste it in the same .py file,, How should i do that??
@KylieYYing3 жыл бұрын
You can just copy the "words = [...]" line into the file instead of importing it
@laksh._.official3 жыл бұрын
How can I add a function which tells me the score which is guess remaining * the unique letters in the word
@Cyan1de.3 жыл бұрын
for some reason im not able to find the list of words... could u provide me with the link please?
@DreamEvilGaming3 жыл бұрын
it says that theres like an error in line 2 what does that mean?
@bahai024 жыл бұрын
Viral karo bandi ko, bohot mast samjhati hai bdw, lots of love from India
@Moonblanc4 жыл бұрын
Hello @Kylie Ying I am having trouble with the code as I keep getting indentation errors on lines 47 and above. Furthermore the program does not place in any words to replace the dashes. please I need ur help urgently
@ninjabathat27924 жыл бұрын
Not sure if you will response, but do you mind explaining the last line of code? if __name__ == '__main__': hangman() not sure what this means but imma assume that it calls the function to run it correct?
@KylieYYing4 жыл бұрын
Yeah definitely, good question. This if-statement is good coding practice for when you have multiple files and larger projects. Basically, this if-statement is telling the computer to only run the stuff after it if it's the file being run (ie if you call 'python3 main.py' or something). However, when we're dealing with multiple files, we don't necessarily want to run these extra lines of code when we run a different file that imports from this one.. something like that. Does this make any sense? You can test this out for yourself with two python files, lets call then main.py and secondary.py. Import secondary.py into main.py. Try having print statements in secondary.py both in the if-statement and outside of it. Then, run main.py and see what gets printed. Run secondary.py and see what gets printed.
@duroka787delapeli Жыл бұрын
hello Kylie, when you write after the hashtag (#) what does it mean? thank you in advance
@kaberanshutisamuel1856 Жыл бұрын
I am not kylie, but let me answer you, you use hashtag when you want python to ignore whatever you write after it so you can use it just for taking notes in your code 🤪🤪
@duroka787delapeli Жыл бұрын
@kaberanshutisamuel1856 cool explanation thank you 🙏
@karenstewart85314 жыл бұрын
I have redid the code three times...same error. It is telling me that the variables are undefined pylint(undefined-variable) even though I can see that they are defined. Any help??
@Nedwin3 жыл бұрын
Kylie you are a Rockstar!!
@Hsalz6 ай бұрын
Great tutorial. Thanks queen!
@איילשיימן-ר2כ2 жыл бұрын
Wow you explained it so well to beginners thank you!!!
@therabidpancake12 жыл бұрын
okay I am getting a bit confused . The words after the hashtag are not required but you write # '-' join [] I do understand that you are trying to label everything as you go
@themegayoutuber4 жыл бұрын
Can you use any words, or does it have to be the ones you used?
@whatiscooler4 жыл бұрын
Thank you so much for this excellent tutorial!!
@rondacorkhill16544 жыл бұрын
Thank you so much for putting these together. I did the entire code but it's not recognizing the letters. Do I need to attach and alphabet file? In both returned words I had letters I guessed.
@KylieYYing4 жыл бұрын
Are you talking about return_word? I accidentally left out the .upper() in there, so check that you have it. It’s likely comparing a lowercase letter to uppercase letter and not recognizing it!
@rondacorkhill16544 жыл бұрын
@@KylieYYing Yup, that was it. I didn't see your earlier reply. Thank you! My old brain is trying to reject learning python and Arcade.
@KylieYYing4 жыл бұрын
You got this :) For a step up from hangman you should check out my unbeatable tic tac toe tutorial! Or if you want a basic crash course, I should be uploading one today or tomorrow!
@nabilovhic4 жыл бұрын
if anyone still see this guys i made the whole game but there is something wroung when i enter a letter it doesnt appear in blanks if it's right how to fix that?
@enciuraluca31004 жыл бұрын
Hi, I dont understand exactly what this line of code works "word_list = [letter if letter in guest_letters else '-' for letter in word]". How to create the connection between "letter" (from this line of code) and the letter we need to guess from the word?
@KylieYYing4 жыл бұрын
This is a list comprehension. I’m trying to make the word a list of letters right here so “word” becomes [“w”, “o”, “r”, “d”]. The text inside the brackets is saying for every letter in word, append that letter to the list if the letter is in the list of guessed letters, otherwise append “-“.
@enciuraluca31004 жыл бұрын
@@KylieYYing THANK YOUUUU
@lahocoschimocotaesdesteusj5593 жыл бұрын
@@enciuraluca3100 bruuuuuuuuuhhhhhhhh
@ben-zz2rm2 жыл бұрын
Great explanation for your hangman script. Kylie. Am having issues running what I have done so far. When I hit run, nothing happens! Can you see where I have made mistake/s please. Note: I had to import the string module because it would not recognize it otherwise. Much obliged from Australia Ben import random # needs to be imported if used in routine import string from words import words # this list of words must be in .py format def get_valid_word(words): word = random.choice(words) # will randomly choose a word from the list in "words" file while "-" in word or " " in word: word = random.choice(words) return word.upper() def hangman(): word = get_valid_word(words) word_letters = set(word) # the letters in the word alphabet = set(string.ascii_uppercase) used_letters = set() # the user has guessed the letters while len(word_letters) > 0: user_letter = input(" Guess a letter: ").upper() if user_letter in alphabet - used_letters: used_letters.add(user_letter) if user_letter in word_letters: word_letters.remove(user_letter) elif user_letter in used_letters: print("You have already used that letter. Please try again. ") else: print("Invalid character Blockhead !. Only select letters from the alphabet. Try again. ")
@corinx4 жыл бұрын
Hey! This video was great !!! but, just one small ajustment pls, i really liked the #....... so i would really like to see that for more of the lines, im a begginer so im kinda dumb. Anyways thxxxxxxxxxxx
@KylieYYing4 жыл бұрын
The comments? Sure
@rishikapoor97874 жыл бұрын
please help to explain this line "word_list = [letter if letter in used_letters else '-' for letter in x]", you have written in one line but if i were to understand in 2-3 lines of code what does it mean. thank you so much.
@KylieYYing4 жыл бұрын
This is a list comprehension Word_list=[] For letter in x: If letter in used_letters: Word_list.append(letter) Else: Word_list.append(‘-‘)
@bandit82583 жыл бұрын
@@KylieYYing sorry but how does this line of code help the "letter" to arrange in the correct order? like at 8:30, when you type "E", the "E" immediately goes to the last word under current word, how does it know what is the correct sequence?
@moodyehab12143 жыл бұрын
I did exactly as you did but it keeps saying unused variables and undefined variables
@lahocoschimocotaesdesteusj5593 жыл бұрын
lol
@helloworld69472 жыл бұрын
my wordlist not showing used_letters
@kreeeooo4 жыл бұрын
Can you send me a link to those list of words please?
@KylieYYing4 жыл бұрын
Check the github link. It should be in there
@mayurravindra94334 жыл бұрын
Awesome❤ Would love to try it now!!
@guersomfalcon75444 жыл бұрын
8:30 I don't understand line 27. I never saw anything like this in Python.
@KylieYYing4 жыл бұрын
That’s a list comprehension but with an if/else statement! Basically it’s saying for every letter, if the letter is in used letters, then use the value of the letter otherwise use “-“. Here’s the expanded equivalent: letters = [] For letter in word: if letter in used_letters: letters.append(letter) else: letters.append(“-“) Does that make more sense?
@guersomfalcon75444 жыл бұрын
Y Cubed Yeah, thanks.
@homenick934 жыл бұрын
So I’m a complete beginner I have seen beginner courses in python already I was a little lost when you did things in terminal are actually supposed to do tasks in terminal to complete this?
@KylieYYing4 жыл бұрын
I run my scripts in terminal but there are other ways that you can run them. I just prefer terminal so I know exactly where I'm running the script from and it's independent of the text editor you use. I'd like to point you to my beginner python series. In the first video (after python download/installation) I talk a bit about how to run your code in terminal and how the pieces (ie terminal, text editor, python) go together: kzbin.info/aero/PLkWv3oO4kHnuKi032yRRYgyQ4kgaNp6gs
@homenick934 жыл бұрын
Ohhhhh wait a second you meant the terminal in python
@lahocoschimocotaesdesteusj5593 жыл бұрын
@@homenick93 bruh this is advanced, or intermediate, thats like im learning how to print hello world and i wanna know how to code tic tac toe MAN WAKKKKE UPPPP
@errykocalumag45793 жыл бұрын
maam whats the difference between " " and ' ' is there any difference between them?
@KylieYYing3 жыл бұрын
No difference in Python, both are strings
@codapi74414 жыл бұрын
Which website are you coding on?
@lahocoschimocotaesdesteusj5593 жыл бұрын
its not a site, its pycharm, download it
@Userisnmuh3 жыл бұрын
thank you vey much for all of your tutorials, it's helping me a lot :thumbs up:
@KhalilYasser3 жыл бұрын
Amazing tutorial. Thanks a lot.
@SuperFirstSerg4 жыл бұрын
thx for the hangman video,it was very helpful😀
@KylieYYing4 жыл бұрын
Glad it helped!
@SuperFirstSerg4 жыл бұрын
@@KylieYYing which sites do you recommend for learning python ?
@KylieYYing4 жыл бұрын
MIT opencourseware has some lectures if you want to learn the fundamentals beyond how to code.. but if you’re like me and you like doing more than listening, you can also check out codecademy!
@SuperFirstSerg4 жыл бұрын
@@KylieYYing thanks , I'm currently doing a specialisation in python at coursara and after that I'm to learn in Codecademy a course that focuses on data analysis with python . Thanks for the suggestion , I always looking for new sites to learn from.
@subhodipdas6524 жыл бұрын
That list contains 2466 words to be exact, it doesn't have 5000 words as it mentioned Great tutorial btw!
@KylieYYing4 жыл бұрын
Thank you! Good catch!
@lijoso25734 жыл бұрын
Hi Kylie Ying : I already install-----> pip install random-word ---> and successful installs , but still i get Error ---> Traceback (most recent call last): File "C:\python\Python37\Hangman program.py", line 2, in from words import words ModuleNotFoundError: No module named 'words' even i install , alpha words and words dictionary , but still in not working , what can i do more, please help
@KylieYYing4 жыл бұрын
It’s not a package, it’s a separate file. Please check out this video: kzbin.info/www/bejne/fWnRpGV-rdWAZrc
@ogaimon3380 Жыл бұрын
love your videos
@lijoso25734 жыл бұрын
Hi Kylie Ying: now i get this problem --->>Traceback (most recent call last): File "C:\python\Python37\Hangman program.py", line 2, in from words import words ModuleNotFoundError: No module named 'words' ---> so how can i solve this problem, please help. thank you
@KylieYYing4 жыл бұрын
You need to have a file words.py where words is a variable in that file. I have the words variable as a list of words. So this statement, from words import words, it's saying look at the words.py file (from words), and get the words variable so that we can access it in our current file (import words)
@josebarreto66944 жыл бұрын
Thanks so much I learned a lot!
@meshalalsaeed12684 жыл бұрын
what a great simple way to explain gd job ..... keep it up
@laughing-out-loudhd9963 жыл бұрын
Underated Channel ! !... .. keep being awesome... Q: what IDE u using ?
@lahocoschimocotaesdesteusj5593 жыл бұрын
Pycharm
@lijoso25734 жыл бұрын
how can i solve this syntax - if user_letter in alphabet - used_letters:
@KylieYYing4 жыл бұрын
Syntax seems fine, depends what the specific issue you're having is
@lijoso25734 жыл бұрын
@@KylieYYing :
@lijoso25734 жыл бұрын
user_letter = input("Guess a letter:".upper() used_letters.add(user_letter) if user_letter in word _letters: word_letters.remove(user_letter) print("")
@KylieYYing4 жыл бұрын
Well you’re missing the closing parentheses in the first line and you have an extra space in a variable name in the third line...
@hichourap17814 жыл бұрын
Awesome video ❤️ , Thank you
@KylieYYing4 жыл бұрын
:)
@chanakyaks39364 жыл бұрын
Just loved it❤️
@jameskulu4 жыл бұрын
Great video. I love it Please make more videos like this I would be more happy if you upload some django stuffs
@KylieYYing4 жыл бұрын
Thank you! You should check out my latest video - it is a tutorial on flask and how to integrate backend into a website. Today, in approx 45 mins, I am releasing a video on VueJS and how to code front-end for a website using Vue! Make sure to subscribe for more videos - I'll see what I can do with django.
@jameskulu4 жыл бұрын
@@KylieYYing okay thanks a lot
@KylieYYing4 жыл бұрын
Hey, I’m considering using Django to create a new page on my website that allows people to enter feedback or something similar to that.. would that be a tutorial you’d like to see?
@jameskulu4 жыл бұрын
@@KylieYYing yes of course. It will be great too see that :)
@alex-lk7sq Жыл бұрын
make a variable (v) set to 0 then while turns>0: for l in chosenwords : if l in theletter: count = count +1 print (l,end="") else: print ("_",end="") v += 1 for a easy way to print _
@mathsmagician69494 жыл бұрын
Really great video, thanks a lot
@prateek94056 ай бұрын
mine didnt work
@leelamaruthisrikakulapu73252 жыл бұрын
Thanks a lot Kylie Ying
@rebegg994 жыл бұрын
Great tutorial!
@rebegg994 жыл бұрын
I think something went wrong in my code, though, as i tried all the letters in the alphabet and it said that they were all wrong.
@KylieYYing4 жыл бұрын
check the case of the letters (check out my pinned comment)
@sunnyfreedomfighter4 жыл бұрын
Thanks alot for the video!!!! i tried to make the game on my own...failed!!....thanks again...keep safe...from london :D
@KylieYYing4 жыл бұрын
:) Happy to help!
@sunnyfreedomfighter4 жыл бұрын
one problem i realised. is that i cant seem to import the words from my word file!....i will try to solve problem on my own....if not i will come back defeated and asking for help.....hope you are well!
@KylieYYing4 жыл бұрын
I just came out with a new video for a beginner crash course in Python, so that might help you out :) kzbin.info/www/bejne/fWnRpGV-rdWAZrc
@sunnyfreedomfighter4 жыл бұрын
@@KylieYYing thank you. I will check it out later... currently doing night shifts for two weeks. Then I can indulge myself in python. P.s I've checked your website out ...you seem to be a secret agent of some sort!! Literally motivated me to learn roller blading. I hope you are safe and happy! Many thanks ::))
@peterpancakeA4 жыл бұрын
So cool, i try to improme my english and my code level in the same time . I saw that you studied in France. I'm french do you speak french?
@KylieYYing4 жыл бұрын
un peu haha
@lahocoschimocotaesdesteusj5593 жыл бұрын
@@KylieYYing hello what's your native language?
@lisali62054 жыл бұрын
Thank you. I like to watch your typing.
@laughing-out-loudhd9963 жыл бұрын
Ya luv Python.. if am nt mistaken.. I luv Python too... ! .. post more video .. liking it !
@khawarabbas1003 жыл бұрын
What is this Coding for. What is its output product.
@NK47k3 жыл бұрын
now how do I link this with my discord bot?.
@udayy44484 жыл бұрын
LEGEND
@Frazle_4 жыл бұрын
where do you get python?
@KylieYYing4 жыл бұрын
Frazle great question! You can get python online here: www.python.org/downloads/ And then you can download a free text editor such as pycharm, atom, sublime, etc.. (can be found online) Would it help if I made a tutorial on how to get started using python?
@Frazle_4 жыл бұрын
Y Cubed well I was making a game for someone’s website for a degree in tongues but it has to be handed in tomorrow so I don’t think I have time to do it but it would be a good idea for a vid for beginners on python
@Frazle_4 жыл бұрын
Y Cubed good video btw 👍🏻
@KylieYYing4 жыл бұрын
Thank you :) I’m planning on making more coding videos in the future!!
@lahocoschimocotaesdesteusj5593 жыл бұрын
bruh this is insane, ppl who dont know where to get python are learning this? keep calm Frazle, go calm, slowerrrr
@do_ctor_d4764 жыл бұрын
how do you play the game
@KylieYYing4 жыл бұрын
You can run it from terminal on mac or command prompt on windows! Check out my python crash course if you’re interested in learning more
@codewithparth84314 жыл бұрын
Great video's
@carllewis67453 жыл бұрын
Thank you.
@lucian86182 жыл бұрын
I ended in an infinite loop , almost crushed
@udayy44484 жыл бұрын
full code: import random from words import words import string def get_valid_word(words): word = random.choice(words) # randomly chooses something from the list while '-' in word or ' ' in word: word = random.choice(words) return word.upper() def hangman(): word = get_valid_word(words) word_letters = set(word) # letters in the word alphabet = set(string.ascii_uppercase) used_letters = set() # what the user has guessed lives = 6 # getting user input while len(word_letters) > 0 and lives > 0: # letters used # ' '.join(['a', 'b', 'cd']) --> 'a b cd' print('You have', lives, 'lives left and you have used these letters: ', ' '.join(used_letters)) # what current word is (ie W - R D) word_list = [letter if letter in used_letters else '-' for letter in word] print('Current word: ', ' '.join(word_list)) user_letter = input('Guess a letter: ').upper() if user_letter in alphabet - used_letters: used_letters.add(user_letter) if user_letter in word_letters: word_letters.remove(user_letter) print('') else: lives = lives - 1 # takes away a life if wrong print(' Your letter,', user_letter, 'is not in the word.') elif user_letter in used_letters: print(' You have already used that letter. Guess another letter.') else: print(' That is not a valid letter.') # gets here when len(word_letters) == 0 OR when lives == 0 if lives == 0: print('You died, sorry. The word was', word) else: print('YAY! You guessed the word', word, '!!') if name == 'main': hangman()
@lahocoschimocotaesdesteusj5593 жыл бұрын
i did the same stuff with 60 lines of code LOL
@udayy44483 жыл бұрын
@@lahocoschimocotaesdesteusj559 send
@lahocoschimocotaesdesteusj5593 жыл бұрын
now its not 60 lines bc i added the little body as levels, and if i show it im scared someone steal it, i just give these steps: 1.Learn list(appending) 2.Learn enumerate now use ur logic and do it
@NSVSTB2 жыл бұрын
Thank you so much. Saved me from constantly getting blank when i run the codes!
@glowria_balla43322 жыл бұрын
ImportError: cannot import name 'words' from 'words' (unknown location) I keep seeing this
@whyisgamaretaken4 жыл бұрын
Subscribe to this guy, he is insane
@ayoubguennane52305 жыл бұрын
perfect
@KylieYYing5 жыл бұрын
ayoub guennane thanks! Glad you enjoyed it :)
@vortex41092 жыл бұрын
Here's the first part of my code: import random from words import words def get_valid_word(words): word = random.choice(words) # randomly chooses word while "-" in word or " " in word: word = random.choice(words) return word def hangman(): word = get_valid_word(words) word_letters = set(word) # letters in word alphabet = set(str.ascii_uppercase) used_letters = set() # what the user has guessed #getting user input while len(word_letters) > 0: #letters used print("You have already used these letters: ", " ".join(used_letters)) # What current word is ( ie W - R D) word_list = [letter if letter in used_letters else "-" for letter in word] print("Current word: ", " ".join(word_list)) user_letter = input('Guess a letter').upper() if user_letter in alphabet - used_letters: used_letters.add(user_letter) if used_letters in word_letters: word_letters.remove(user_letter) elif user_letter in used_letters: print("You have already guessed that character. Please try again.") else: print("Invalid character. Please try again.") user_input = input('Type something: ') I've tried using it but here's what happens in terminal: Type something: e Type something: e Type something: e Type something: e Type something: e Type something: e Type something: ee Type something: e Type something: e Type something: e Type something: e Type something: e Type something: e Type something: ee Type something: e Type something: e Type something: e Type something: Type something: e Type something: e Type something: e Type something: e Type something: e Type something: e Type something: e Type something: e Type something: e Type something: e Type something: e Type something: e Type something: e Type something: e Type something: Type something: a Type something: a Type something: a Type something: a Type something: dw Type something: dad Type something: Type something: fa Type something: g Type something: Type something: rhgr Type something: grazs Type something: rgsd Type something: drg Type something: grdhjt Type something: htdtgh Type something: drg Type something: [ ] Any help???