I am not able to understand why am i getting this other can someone pls explain why this eof error is coming
code
s=0
while s>=0:
n=int(input())
s+=n
if s<0:
break
print(n)
error
Traceback (most recent call last):
File “source”, line 3, in
n=int(input())
EOFError: EOF when reading a line
Python eof error
Hello Maurya !! It is working fine just check you are also giving providing the input and just take care of indentation and spaces. And also make sure while giving the input each line consists only one no. and after that there will be no space just enter to get into the next line.
I hope this will work fine now and you will understand this. In case there will be any confusion just msg me I will help you out. And pls mark it as resolve in case it is clear to you and also provide the feedback so that we can improve our services.
Thanks
Happy Coding !!
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.