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