+ 5
What am i doing wrong?
i am creating a calculator , it gives me correct answer but with warning eof error - eof error while reading a line. pls help me https://code.sololearn.com/cAuzRj37GV6z/?ref=app
5 Answers
+ 1
it works, I think it is Solo Learn and they eat they interpret input, I uploaded 2 images below showing how Solo Learn expects multiple inputs
https://ibb.co/gcNBJK = inputs
https://ibb.co/hZtwkz = output
+ 4
Actually, you're doing nothing wrong!
The problem is with Sololearn's code playground, that takes all the input in the beginning.
Paste the code into IDLE for example, and it works like a charm :)
+ 2
Hi,
it's the web surface...
In the pop up window you need to enter all inputs at once on separate lines before submitting it. The problem is, that your loop will keep asking for user input endlessly.
What you could do, is to add another if statement like "quit" for example, and use that to break the loop:
...
if user_input == "quit":
break
...
Then if you run it, just type in as many test cases as you want, and add quit on the last line, submit them all at once and then it should work.
For example:
add
1
2
multiply
43
78
quit
I don't know, if there's a better way, which can handle user input interactively...
Anyway, I hope it helps!
+ 1
use the elif statement instead of repeating if,
- 4
hi every one