Please check why my solution is wrong. Its showing correct output though

lst = []
sum=0

n = int(input())
if n>-1000 and n<1000:
for i in range(n):
ele = int(input())
lst.append(ele)

for j in lst:
sum=sum+j
if sum>=0:
print(j)

Here is the link to my code: https://ide.codingblocks.com/s/235690

Hello @bhavikak,

Actually in your code, you are taking an input which is the length of n and the question doesnt provide any such input. Hence, you are getting wrong answer.

Check this out, this code works.

Let me know if you face any problem.

Happy Learning :smile: