sum=0
a=[]
while sum>=0:
j=int(input())
sum+=j
if sum<0:
break
a.append(j)
for s in a:
print(s)
i m getting eof error in this code. plz help
sum=0
a=[]
while sum>=0:
j=int(input())
sum+=j
if sum<0:
break
a.append(j)
for s in a:
print(s)
i m getting eof error in this code. plz help
Hello @i.m.anand_31, try by taking some input and that too in the correct format every no. will be in a separate line. And also we don’t need to return the whole list again and again instead of printing the list again and again. Just print the last entered element. Pls, give the input and make it correct and then try submitting that. In case if it won’t get submitted as correct answer pls let me know. And if it gets cleared then pls mark it as resolve and feel free to provide the feedback and the ratings.
Thank You 
Sir i am not able to write the code for the same pls help.
sum=0
while sum>=0:
j=int(input())
sum+=j
if sum<0:
break
print(j)
Pls, see this what we need to do according to the given ques. We don’t need to print the full list of nos. everytime.
And this is also correct.
sum=0
a=[]
while sum>=0:
j=int(input())
sum+=j
if sum<0:
break
a.append(j)
for s in a:
print(s)
Try submitting this as well. In case on simple running you see the error then try inputing some values and make sure about the spaces and all in the input as well.
It might be possible in case of inputting 5
you have written 5 and then space like
5
then it would get wrong.
Thank u sir now clear.
Pls, mark it as resolve and feel free to provide the feedback.
Thanks 