
能看一下那三条注释下我的代码有什么问题,就是运行不了,太难受了,感谢帮助

能看一下那三条注释下我的代码有什么问题,就是运行不了,太难受了,感谢帮助
n = 100
lst = [1] * n
pos = 0
cnt = 0
total = 0
while True:
while lst[pos] == 0:
pos = (pos + 1) % n
total += 1
if cnt == n - 1:
break
if total % 3 == 0:
lst[pos] = 0
cnt = cnt + 1
pos = (pos + 1) % n
print(lst.index(1) + 1)