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)

3rd Feb 2022, 6:45 AM
Unnikrishnan K
4 ответов
+ 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
3rd Feb 2022, 7:14 AM
Bartek
+ 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.
3rd Feb 2022, 7:03 AM
Bartek
+ 1
Thank you so much it worked 👍🏻
3rd Feb 2022, 7:38 AM
Unnikrishnan K
0
Thank you for you reply. How I'm getting syntax error in elif line when I do so!
3rd Feb 2022, 7:09 AM
Unnikrishnan K