python3中continue用法

python3中continue释义

continue作用是结束本轮循环并继续下一轮循环

具体代码如下:

1 count=0
2 while count<100:                  #count小于100时进入while循环
3     count+=1
4     if count>5 and count<96:    #count满足大于5小于96时终止此次循环开始下次循环
5         continue   
6     print('loop',count)
7 print('.....out of loop while....')    

执行结果为:

1
2
3
4
5
96
97
98
99
100
......out of while loop.....

Process finished with exit code 0

 

posted @ 2021-12-02 15:38  Tank-tank  阅读(967)  评论(0)    收藏  举报