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)