continue:表示终止当前循环,开始下一次循环

break:终止所有循环

s = 0
while s < 3:
    s += 1    
    print(s)
    continue#'@'
    print(abc)
print('end')

#@处为continue:
1
2
3
end

#@处为break:
1
end

 

相关文章:

  • 2020-12-21
  • 2022-02-25
  • 2022-02-26
  • 2022-01-18
猜你喜欢
  • 2021-12-25
  • 2022-01-13
  • 2021-11-10
  • 2021-12-25
  • 2021-11-29
  • 2022-12-23
  • 2020-04-19
相关资源
相似解决方案