0
Getting EOFE Error = EOF when reading a line. Can some one please look into this and guide how to resolve this?
score = 100 shot = 4 while (shot>0): result = input() if result == "hit": score += 10 shot -= 1 elif result == "miss": score -= 20 shot -= 1 print (score)
4 Answers
+ 2
score = 100
shot = 4
while (shot>0):
result = input()
if result == "hit":
score += 10
shot -= 1
elif result == "miss":
score -= 20
shot -= 1
print (score)
Copy this code and it should work(tested) you probably forgot to add statmens to if/elif while moving if/elif
+ 1
You need to move if and elif to the while loop. And becouse it is sololearn you need to input all 4 inputs. Next time don't forget about adding a coding languge to the description.
+ 1
Thank you so much it worked đđ»
0
Thank you for you reply. How I'm getting syntax error in elif line when I do so!