Simple input practice problem

The code runs in jupyter notebook but givesan EOF error in the CB ide. Can I know the reason? I think it is appropriate according to the question.

Hello @VatsManu, so this is your code

Lstsum = 0
lst = []
while Lstsum > -1:
	element = int(input())
	Lstsum += element
	if Lstsum > -1:
		lst.append(element)

print(lst)

I tried running your code it’s working fine, the only issue is that you are printing the list and we need to print the nos. in the separate line for that we can write the code like this,

Lstsum = 0
lst = []
while Lstsum > -1:
	element = int(input())
	Lstsum += element
	if Lstsum > -1:
		lst.append(element)

for i in lst:
	print(i)

It will work fine and if any error comes pls let me know. And I hope you are using python3 instead of python2.7

Yes I’m using Python3 still I’m getting the same error. Attached Screenshot fyr.Screenshot_3

Hmm, it seems like maybe some indentation error is there. For once pls try that code that I have written.

I tried using your code but still getting the same error.