fork download
  1. l=eval(input());n=len(l);s=0
  2. for i in range(n):
  3. s+=l[i] if l[i]!=0 else break
  4. print(s)
  5.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
[3,6,7,2,0,4,0,45,32,0]
compilation info
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

stdout
Standard output is empty