+ 1

Can anyone help me with this?, .. am getting an "EOFError" in a line that requests for user input and I don't know what it means

The code runs quite well in my qpython 3 console...but its returning an EOFError in sololearn python playground . . count = 0 while count < 1: num = input() numi = input() if num <= "500": i get an EOFerror in line 4 ie..[numi = input ()]

8th Sep 2018, 6:27 AM
wizHÆVÊN§
wizHÆVÊN§ - avatar
1 Antwort
+ 2
There are several things wrong with your code. (line 1) your variables can't start with a period, try removing that first. (line 5) Your "if" statement is trying to compare your input from line 3 (inputs are always strings before you convert them), with another string "500" (because it is surrounded by quotes), using a mathematical operator. Try converting your number using int(num), and removing the quotes around "500" in order to turn it into a number. Finally, your if statement is missing a colon (:) at the end of that line. (lines 5,6) Finally, your "if" statement is missing a followup statement. Try to think of if statements as a sentence. "If it is raining: I bring an umbrella print("I took a nice walk today.")" A lot of people refer to if statements as "If, then" statements, because they always have followups. Good luck with your code!
8th Sep 2018, 8:22 AM
mrhonk123
mrhonk123 - avatar