while True 死循环示例: count = 0 #给count设置变量为0
while True:
count += 1 #每循环一次,count+1 ; count += 1 等同于count = count+1 意思是一样的
if count >=50 and count <=60: #对比count的值,设置循环中50-60之间的字符不打印
continue #如果条件匹配,到这里就不往下执行了,continue回到起点
print ("张江华",count) #打印,count 输出打印的次数
if count ==100: #循环如果到100次,就跳出循环
print ("已经循环够了100次,退出循环!")
break
相关文章
- SQL WHILE 循环中的游标 用例,SQL中实现循环操作
- error while loading shared libraries: libudev.so.0 的问题
- fpm模式下读取到is_cli为何为true
- 异常Crash之 NSGenericException,NSArray was mutated while being enumerated
- java基础--while循环实现水仙花数
- 四、python之 if while for
- 你想知道的do{...}while(0)的作用,都在这里了
- 三种循环的比较 do...for...while... java 230218
- c while 循环
- while循环补充、for循环、range关键字、内置方法之整型、内置方法之浮点型、内置方法之字符串