Description: Given a list of numbers, stop processing input after cumulative sum of all the input becomes negative.
Code:
x=input()
list=x.split()
sum=0
for num in list:
sum += int (num)
if(sum>=0):
print(num)
else:
break
This code works fine in jupyter notebook but not in the compiler given here. It shows some error. Please, help me out with this!