+ 2
Python Error Taking User Input
Hey guys, can someone explain that error to me? I am totally confused. I used this line of Code ( age = int(input()) ) in another program and it works…. :( total = 0 #your code goes here x = 0 while x <= 5: x += 1 age = int(input()) if age < 3: continue total += 100 print(total)
10 Respostas
+ 4
You're taking six (x=0 to x=5).
+ 2
EOF Error occurs in sololearn when reading user input.
Because it reads all lines in the beginning, so you have to enter all inputs in the input box in separate lines.
Eg. (input)
5
10
20
49
8
90
+ 1
In this particular case the EOF error occurs because you ask for more inputs than sololearn provides. Make sure your loop has the right amount of iterations.
+ 1
Oh of course, i really didnt see that… thank you
0
What type of error did you find?
Do you mean EOF Error?
0
Yes, its EOFError: EOF when reading a line.
Its the line where i wanna store the input in the variable age
0
This is a „Code Coach“ task in a Course, so i can‘t enter the inputs by myself…. But there must be a way to solve the code coach right?
0
I think i am asking for 5 inputs, because the while loop ends when x reaches 5. x is incremented by 1 in every iteration.
Did i make any mistake there?
0
You have to start from 1 then
0
Or if you want to tak 5 inputs simply use
for i in range(5):