EOFERROR line 4 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

EOFERROR line 4

On practice 24.2 I keep get an EOFError total=0 x=0 while x<5: age = int(input()) if age>3: total += 100 x+=1 print(total) This is the exact solution recommended by Sololearn why would I be getting the error.

21st Jun 2022, 1:16 PM
Sean Campbell
8 Answers
+ 1
Thanks for the help. Line 7 was incorrectly indented. total=0 x=0 while x<5: age = int(input()) if age>3: total += 100 x+=1 print(total)
21st Jun 2022, 2:35 PM
Sean Campbell
0
You need to provide all inputs separated by a linebreak. Read the text in the pop-up window.
21st Jun 2022, 1:20 PM
Lisa
Lisa - avatar
0
It is in a test Sololearn is providing the inputs but the error keeps popping up.
21st Jun 2022, 1:23 PM
Sean Campbell
0
Your program need to accept 5 inputs exactly.. But what if age > 3 is false, then it's ask one more extra input, because x value don't changed.
21st Jun 2022, 1:24 PM
Jayakrishna 🇮🇳
0
20 35 2 Are the inputs sololearn is testing against looking for a answer of 200.
21st Jun 2022, 1:30 PM
Sean Campbell
0
@Sean Test your value of x in loop each time. There are 2 more inputs, scroll down and see.. You need to update x value in each iteration to loop exactly 5 times only.. But it will not update x when age>3 false.
21st Jun 2022, 1:35 PM
Jayakrishna 🇮🇳
0
Sorry I am a beginner. If I manually put a number in it works fine it is just an error sololearn is getting on line 4.
21st Jun 2022, 1:43 PM
Sean Campbell
0
Sean Campbell x = x + 1 is idented to inside if block so it gets updated on only age > 3 true. Add x += 1 outside if block. (manually also it gets errors on just 5 inputs with if age value(s) less than 3..
21st Jun 2022, 2:18 PM
Jayakrishna 🇮🇳