Error "You failed one or more testcases. This means that your program didn't account for all input cases (did you account for negative numbers, for example?)." Even when I get the desired output

input = [1,2,88,-100,49]
def negsum(list):
sum = 0
for element in list:
if element < -1000 or element > 1000:
print(“Invalid Input”)
break
sum = sum + element
if sum >= 0:
print(element)
else:
break
negsum(input)

Hey @nitin.khatri907, can you please share the link of the online IDE where you must have written your code ? It is difficult to debug without indentation !

Thanks :slight_smile:

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.