There is problem, for which a complete or no description is given, i tried but getting error

Given a list of numbers, stop processing input after the cumulative sum of all the input becomes negative.

def pp(li,i):
for j in range(i):
print(li[j],end="")
break
def cum(li):
sum=0
for i in range(len(li)):
sum=li[i]
if sum>=0:
sum+=li[i]
else:
break

li=[int(x) for x in input().split()]
cum(li)

You have to take input as well in loop, since all of them wll be in next line and not in a single line as you assumed.

If still unable to solve it, leave a message so that we can help you out.
Happy Learning.

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.