Input challenge

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

l = len(a)

s = 0

for i in range(0,l):

s = s+a[i]
if s>0:
    print(a[i])
else:
    break

sir can you tell me what’s wrong in this code

Hey @Sanch1t, you have to take the input in a new line and not as a list. Try to take input using a while loop continuously and then inside that loop check if the condition is met or not.

Hope this helps.
All the best :slightly_smiling_face:

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.