l=eval(input());n=len(l);s=0 for i in range(n): s+=l[i] if l[i]!=0 else break print(s)
[3,6,7,2,0,4,0,45,32,0]
Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib/python2.7/py_compile.py", line 117, in compile raise py_exc py_compile.PyCompileError: File "prog.py", line 3 s+=l[i] if l[i]!=0 else break ^ SyntaxError: invalid syntax
Standard output is empty