为啥这种方法就不行呢
file:///C:\Users\gj\AppData\Roaming\Tencent\Users\709926935\QQ\WinTemp\RichOle\_}7ON1K1@BB7i = 0
while i <= 100:
if i % 2 == 0:
i += 1
else:
print(i)
i += 1
本帖最后由 逃兵 于 2021-4-4 16:40 编辑
i = 0
while i <= 100:
if i % 2 == 0:
i += 1
else:
print(i)
i+=1
缩进问题,i+=1写在外面的话,会永远满足i%2==0 逃兵 发表于 2021-4-4 16:39
缩进问题,i+=1写在外面的话,会永远满足i%2==0
感谢 大佬
页:
[1]