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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM