0
Help practice Pull the trigger
this my code p = 100 i = 1 while i <= 4: if input() == "hit": p += 10 elif input() == "miss": p -= 20 i += 1 print(p) I keep getting this error: Traceback (most recent call last): File "/usercode/file0.py", line 8, in <module> elif input() == "miss": EOFError: EOF when reading a line I have been traying for a while to discover whats the problem but i cant find it, please helppppppp!!!!
2 Antworten
+ 3
You have to indent the line where you increment i so it is inside the loop.
0
As Simon Sauter said you have to indent i+= 1 to be inside the loop.
You also have to make a variable inside the loop to take inputs exactly 4 times.
while i <= 4:
the_input = input()