
上QQ阅读APP看书,第一时间看更新
3.6.2 continue语句
continue语句被用来告诉Python跳过当前循环块中的剩余语句,然后继续进行下一轮循环,下面通过实例进行说明。
continue语句示例如下。
单击“开始”菜单,打开Python 3.6.5 Shell软件,然后在菜单栏中选择File→New File命令,创建一个Python文件,并命名为Python3-18.py,然后输入以下代码:

在菜单栏中选择Run→Run Module命令或按键盘上的F5键,就可以运行程序代码,结果如图3.25所示。

图3.25 continue语句示例的运行结果