EOF when reading a line error | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

EOF when reading a line error

Your number is bigger Traceback (most recent call last): File "./Playground/file0.py", line 14, in <module> guess=int(input()) EOFError: EOF when reading a line I am getting this error ,please tell me import random as rand num=rand.randint(1,100) guess=int(input()) while True: if guess==num: print("You guessed correctly\n YOU WON THIS GAME\n CONGRULATIONS") break elif(guess>num): print("Your number is bigger") guess=int(input()) else: print("Your number is smaller") guess=int(input())

13th Jun 2020, 8:36 AM
Yogesh Agarwal
Yogesh Agarwal - avatar
1 Answer
+ 2
In sololearn we have to give all output before running the code. So when we the number would be small or bigger than the random one. It will loop again with the second number and if you had entered only one it would show EOF error. And we don't know how many input will it be needed may be even after 99 input it will show EOF error So in sololearn you can't run this code. But this code is correct! May It Helps You 😊
13th Jun 2020, 8:44 AM
Hacker Badshah
Hacker Badshah - avatar