What is the problem with following code. I am getting error EOF. Thanks in advance

What is the problem with following code.
I am getting error EOF.
Thanks in advance.

num=0
cummsum=0
while cummsum >=0:
try:
num=int(input())
if(1000>=num>=-1000):
cummsum=num+cummsum
print (cummsum)
if cummsum<0:
print (“cummulative sum is negavive”)
else:
print (“Number enterned in invalid”)
except ValueError:
print(“This is not a number.”)

Hey @wasi, EOF error occurs when you do not provide the custom input and compile your code. Just give custom input and then try running your code. This error should not occur now. Also you need to follow the input and output format as specified in the question. You do not need to print anything on the console except the output. So remove all the print statements except the one used to print the output.

I hope this helps ! :slight_smile:
Happy Learning ! :+1:

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.