+ 1
Code gives EOF error in Playground
Hello! My code can be found here: https://code.sololearn.com/ccxHBuJe4RWx The problem is that when i enter any number in the items my code gives me the following error: Traceback (most recent call last): File "./Playground/file0.py", line 6, in <module> item = input("Ok, tell me what to add in the list!\n") EOFError: EOF when reading a line If i run it on other editors ( onlinegdb.com or repl.it ) it seems to run fine! I cannot spot any errors in the code, so i am wondering. Have i stumbled on a Code Playground bug? If so i thought it would be reported to the mod team up to now since the code i am running is basic at best.
4 Respostas
+ 5
It's not a Bug. It is coming because you are taking input one by one.
To avoid this take multiple input in seperate line.
Maybe these threads can help you.
https://www.sololearn.com/discuss/1953736/?ref=app
https://www.sololearn.com/discuss/1916715/?ref=app
https://www.sololearn.com/discuss/1544816/?ref=app
https://www.sololearn.com/discuss/1407007/?ref=app
https://www.sololearn.com/discuss/1588387/?ref=app
https://www.sololearn.com/discuss/1906785/?ref=app
+ 4
it's a limitation of Playground, you have to write all inputs at once each one in new line.
it's not interactive. it doesn't wait for while loop each time.
try :
2
apples
oranges
then submit
+ 2
Thank you, this clears the confusion. I might have missed it, but it would be beneficial for new learners to add a note when Code Playground is introduced - while the prompt makes sense, it does so retrospectively.