+ 2
Help with EOFError [SOLVED]
There is this EOFError popping up. I don't get it quite, because it says it is in a line I didn't even write!? I wanted to make a calculator typing in only one line in user input (like 45+12) I tried to except the error but then there is still no output :( Can somwocheck it?? https://code.sololearn.com/cm1rlfP8ZkMF/?ref=app
4 odpowiedzi
+ 6
As there is only one input to give, the problem does not come from the input behavior of playground.
The first issue is that you use try: without having an except: for this. when I iserted an except at the end of the code, the program is running in this section, so there is something that causes an error. Put this snippet at the end of your code, and try to find out what is happening:
....
except Exception as e:
print('except reached', e)
+ 7
You have to put the whole input at once (at the starting) only!
+ 1
Can you explain it further. I'm sorry, I am a newbie ..
Do you mean input in the first line of code?
+ 1
Thank you! both of you