+ 1

My code works fine but when I move it to solo learn to share it gives me EOFError. Please help!

So this is my first project ever. I have been using solo learn to learn python. I decided to do a number guessing game to test my abilities. I didn't use any outside sources or anything so I'm really proud of it and want to share it, but when I copy and paste the code it gives me an EOFError. This is really strange because on the app I used to write it it works perfectly but on solo learn playground it gives me this error. The error happens on a part of the code where I ask for the user input like so: def next_guess(): global player global answer while player != answer: player = int(input()) right_or_wrong() This works fine on the other app but on solo learn it says the player = int(input)()) line is wrong. Please help me if you can because I really want to share :)

26th Aug 2020, 7:05 PM
Max Smith
4 ответов
+ 5
Your program is likely fine. The SoloLearn Code Playground for Python is not interactive, so all inputs must get entered before the program runs. If there are too few inputs at run time, then it reports an EOF (End Of File) condition when it fails to read the next value.
26th Aug 2020, 7:16 PM
Brian
Brian - avatar
+ 5
Because sololearn's console is non-interactive so users can't enter input during the running and you can just enter the input at the first. If you have several inputs in your app you should enter all inputs at the fist and split them with new line
26th Aug 2020, 7:15 PM
Sadness
Sadness - avatar
+ 4
You need to provide all the inputs on sololearn first time only ,with whatever extra inputs required to break while loop as well
26th Aug 2020, 7:15 PM
Abhay
Abhay - avatar
+ 3
In the Payground here all inputs should be done at the same time. An „interactive“ input is impossible.
26th Aug 2020, 7:18 PM
JaScript
JaScript - avatar