(Solved) Guys i have a very bad problem called EOF Error how to fix it plz | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

(Solved) Guys i have a very bad problem called EOF Error how to fix it plz

fire = 100 test = 0 while test <= 4: result = str(input()) if result == "hit": fire += 10 test+= 1 elif result == "miss": fire -= 20 test+= 1

1st Sep 2021, 12:20 PM
Mino Gaming
Mino Gaming - avatar
5 Answers
+ 3
Mino Gaming 1 - You have to take only 4 inputs so there test should be initialise with 1 2 - input () function bydefault returns string so no need to cast with str 3 - no need to write test += 1 in each condition, just write once.
1st Sep 2021, 12:39 PM
A͢J
A͢J - avatar
+ 2
Hi Mino! That's because you're taking an extra input in your code. But, you're supposed to take only 4 inputs here. There many ways to solve this eof error. 1. You can start your variable test from 1. 2. You can change your while condition test <4:
1st Sep 2021, 12:32 PM
Python Learner
Python Learner - avatar
+ 1
I didn't understand the question but I solved the problem of error, do you mean like this https://code.sololearn.com/c72Rb9It28hC/?ref=app
1st Sep 2021, 12:25 PM
<★Shaurya Chauhan★>(ACTIVE AGAIN✌😇🙃)
<★Shaurya Chauhan★>(ACTIVE AGAIN✌😇🙃) - avatar
+ 1
JUMP_LINK__&&__Python__&&__JUMP_LINK Learner Wow Thanks alot i solved it finally 🌹
1st Sep 2021, 12:38 PM
Mino Gaming
Mino Gaming - avatar
0
<★Shaurya Chauhan★>(Inspiration will draw you) thanks for your help but sadly this isn't what i mean it's a challenge called pull the trigger and iam doing everything correctly but somehow it doesnt work for an error called EOF error and again thanks for your time :)
1st Sep 2021, 12:32 PM
Mino Gaming
Mino Gaming - avatar