小编Mil*_*ani的帖子

python while循环中的Continue语句

我是 python 的初学者,我在使用这段代码时遇到了问题:

count = 0

while count <15:
   if count == 5:
      continue
   print(count)
   count += 1
Run Code Online (Sandbox Code Playgroud)

当 count 的值 = 5 时,它会停止循环,就像有一个break语句一样。为什么会这样呢?请帮忙!

python continue break while-loop

0
推荐指数
1
解决办法
2352
查看次数

标签 统计

break ×1

continue ×1

python ×1

while-loop ×1