python的continue和break

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

break:终止所有循环

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

#@处为continue:
1
2
3
end

#@处为break:
1
end

 

posted @ 2019-10-09 12:11  千焱  阅读(3235)  评论(0编辑  收藏  举报