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

猜你喜欢

转载自www.cnblogs.com/qyan-blog/p/11640974.html
今日推荐