fork download
  1. # your code goes here
  2. #prethiv.n
  3. n=input()
  4. l=list(map(str,n.split("0")))
  5. l[len(l)-1]=0
  6. print("hi")
  7. print(l)
  8. for i in range(len(l)-1):
  9. if i==len(l)-2:
  10. s=l[i]
  11. for j in len(s):
  12. if j==len(s)-1:
  13. print(s[j],end="")
  14. else:
  15. print(s[j],end=" ")
  16. else:
  17. s=l[i]
  18. for j in len(s):
  19. print(s[j],end=" ")
Runtime error #stdin #stdout #stderr 0.01s 27712KB
stdin
1110110101
stdout
hi
['111', '11', '1', 0]
stderr
Traceback (most recent call last):
  File "./prog.py", line 18, in <module>
TypeError: 'int' object is not iterable