0

What's wrong with the code?

Incorrect is displayed even when the input is part of the word. I also get an EOFError at line 22. Also, how do I continue the game without having it reset (on the enter-input prompt from the compiler, I can enter whatever, but when I close it it resets the word; I assume this simply has to do with how it's set up and me needing to code it someplace else)? I'm a big noob, both to Python and SoloLearn, so sorry 😅 https://code.sololearn.com/cNH1xr8r76Y7/?ref=app

18th May 2021, 9:14 PM
Dea Mer
5 Respostas
+ 3
Hey so i played it in pydroid! I just typed in the whole alphabet as my first guess and won... are you doing sort of like a hangman game? Dea Mer also sololearn has to take all input at once. Not the best for interactive programs... pydroid is a good alternative to run your more interactive code
18th May 2021, 9:22 PM
Slick
Slick - avatar
+ 2
Dea Mer your code looks ok, i think is an input issue with sololearn
18th May 2021, 11:33 PM
john ds
john ds - avatar
0
Ohhh. Thanks so much! :) One question: how would I get Incorrect to print ONLY when the entered input is incorrect?
18th May 2021, 11:46 PM
Dea Mer
0
secret_word = "awesome" guess = input("Guess a word: ") if guess == secret_word: print("Got it!") else: print("Nope!")
19th May 2021, 12:50 AM
Slick
Slick - avatar
0
Woo! Got it all fixed. Thanks so much :)
19th May 2021, 4:50 AM
Dea Mer