+ 1

Input error

What's wrong with line 4?? i = 0 while True: i = i +1 if i == int(input()): print(("Skipping")+str(i)) continue if i == 5: print("Break") break print(i) print("Finished")

4th Feb 2017, 4:48 AM
C.R.Devila
C.R.Devila - avatar
3 Answers
+ 2
if all you want your code to do is accept a number of input values printing 'Skipping + X' when the input matches the value of i before finally quitting then there is nothing wrong with the code. The problem is the code testing environment here is not setup to take multiple inputs. If you have python installed on a computer then run it in the python shell and you will see it work's ok.
4th Feb 2017, 6:42 AM
richard
+ 1
assign the input to a variable x = int(input()) then if i == x: ....
4th Feb 2017, 5:20 AM
Kawaii
Kawaii - avatar
+ 1
@N3tW0rk I did it, but the output still showed "EOF error"
4th Feb 2017, 6:08 AM
C.R.Devila
C.R.Devila - avatar