<分区> 分区>
有没有办法在 Python 中编写一个无限循环?
for t in range(0,10):
if(t == 9): t= 0 # will this set t to 0 and launch infinite loop? No!
print(t)
一般来说,有没有办法在不使用 while 循环的情况下像 java 一样编写无限的 pythonic for 循环?
<分区> 分区>
有没有办法在 Python 中编写一个无限循环?
for t in range(0,10):
if(t == 9): t= 0 # will this set t to 0 and launch infinite loop? No!
print(t)
一般来说,有没有办法在不使用 while 循环的情况下像 java 一样编写无限的 pythonic for 循环?