- 从零开始学Python大数据与量化交易
- 周峰 王可群
- 166字
- 2021-03-30 19:09:39
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语句示例的运行结果