0

how to run python code in solo learn without EOF error? (i m looking for the easiest way)

x = 0 z=20 y=10 sum=100 #n=str(input()) while x < 4: n=str(input()) if n=='hit': sum+=y elif n=='miss': sum-=z else: sum+=0 x += 1 print(sum)

20th Dec 2022, 9:49 PM
Nariman Tajari
Nariman Tajari - avatar
2 Antworten
+ 1
In sololearn, EOF error occur when your code want input but you didn't give the input (happens when using input() in loop). Sololearn wants you to give all the necessary input before actually running the code. Fix: According to your code Input should be: hit hit hit hit You should give 4 input(in new line) to your code and also you don't want to explicitly covert that input data to string since the input() returns the data in string datatype
20th Dec 2022, 11:28 PM
Kishor Ramanan
Kishor Ramanan - avatar
0
Eof sometimes veryhard to spot definitely in sololearn, in your case it may be youre not putting in 3 0r 4 different answer on new line when prompt for input , try not to use input in sololearn
20th Dec 2022, 11:27 PM
Ion Kare
Ion Kare - avatar