Python continue 语句
来源:互联网 发布:苏州网络招募中心 编辑:程序博客网 时间:2024/05/22 13:36
Python continue 语句
Python continue 语句跳出本次循环,而break跳出整个循环。
continue 语句用来告诉Python跳过当前循环的剩余语句,然后继续进行下一轮循环。
continue语句用在while和for循环中。
Python 语言 continue 语句语法格式如下:
continue
流程图:
实例:
实例(Python 2.0+)
#!/usr/bin/python# -*- coding: UTF-8 -*-forletterin'Python':# 第一个实例ifletter =='h':continueprint'当前字母 :',lettervar =10# 第二个实例whilevar >0:var =var -1ifvar ==5:continueprint'当前变量值 :',varprint"Good bye!"
以上实例执行结果:
当前字母 : P当前字母 : y当前字母 : t当前字母 : o当前字母 : n当前变量值 : 9当前变量值 : 8当前变量值 : 7当前变量值 : 6当前变量值 : 4当前变量值 : 3当前变量值 : 2当前变量值 : 1当前变量值 : 0Good bye!
阅读全文
0 0
- python------continue语句
- Python continue语句用法
- Python continue 语句
- Python菜鸟--continue 语句
- Python continue 语句
- Python continue 语句
- Python continue 语句
- Python continue 语句
- python中continue语句
- Python学习笔记(continue语句)
- Python break 和 continue 语句
- Python:continue语句的使用
- python中的break语句和continue语句
- python:python语句中的continue和break
- python break,pass,continue 循环语句
- python 学习(九) 之 continue语句
- Python 循环控制语句-break/continue
- Python轻松入门-11 continue语句
- POJ2337 Catenyms【欧拉回路】
- HDU 6090 Rikka with Graph(规律)
- python 中sorted()函数
- OAuth
- OpenCV学习笔记7-图像算术运算
- Python continue 语句
- 进阶2.JavaScript深入之词法作用域和动态作用域
- POJ
- SecureRandom生成随机数超慢 导致tomcat启动时间过长的解决办法
- 数据结构上机测试2-1:单链表操作A
- 深入理解uboot 2016
- shell中exec解释
- Qt总结
- VM12中CentOS7以NAT的方式连接网络的方法