EOFError on sololearn | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

EOFError on sololearn

Hello, I did my first python program. On decoder, with termux or on visual studio, the program work very well, but on sololearn i got EOFError..What's this Error? and How i can patch this error? I try with except but doesn't work... Thanks for help https://code.sololearn.com/cl42I10Wa8b2/?ref=app

29th Dec 2019, 4:34 AM
Aurelien J
Aurelien J - avatar
7 Answers
+ 5
I couldn't get your code to load either, but I would guess you are using a while loop to generate inputs until the answer is correct. In sololearn, all inputs must be generated at commencement of running the code. If you haven't got the correct number, in those inputs, then EOF will be generated by the while loop
29th Dec 2019, 4:46 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 3
åurejien Never wise to play games of chance with a pirate. 🖐😉👍
29th Dec 2019, 4:57 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 2
gosh u can play my wonderfull game also. :(
29th Dec 2019, 4:51 AM
Aurelien J
Aurelien J - avatar
+ 2
Sololearn accepts input in bulk. You get an EOF error when the program asks for input, but there is none. You have to write all your input at the same time, which is probably not ideal if you want to know the response to your previous input (Higher / Lower) before writing your next input. Based on your code, you won’t get an EOF error if your input is something like this: (number) (number) (number) (number) (number) (number) 0 The first six numbers serve as your guessing numbers, while the 0 tells your program not to restart. This keeps your program from looping, and thus, also keeping it from getting an EOF error.
29th Dec 2019, 5:52 AM
Zerokles
Zerokles - avatar
+ 2
привет
29th Dec 2019, 3:24 PM
SK_ programmer
SK_ programmer - avatar
0
EOF means End Of File in general. Since your code seems too goddamn large (didn't load for me), I guess app just isn't suitable for that.
29th Dec 2019, 4:41 AM
Randych
Randych - avatar
29th Dec 2019, 3:45 PM
Aurelien J
Aurelien J - avatar