Python 基礎教程
Python continue 語句跳出本次循環(huán),而break跳出整個循環(huán)。
continue 語句用來告訴Python跳過當前循環(huán)的剩余語句,然后繼續(xù)進行下一輪循環(huán)。
continue語句用在while和for循環(huán)中。
Python 語言 continue 語句語法格式如下:
continue
流程圖:
實例:
以上實例執(zhí)行結果:
當前字母 : P 當前字母 : y 當前字母 : t 當前字母 : o 當前字母 : n 當前變量值 : 9 當前變量值 : 8 當前變量值 : 7 當前變量值 : 6 當前變量值 : 4 當前變量值 : 3 當前變量值 : 2 當前變量值 : 1 當前變量值 : 0 Good bye!