标签:
python while语句
while 循环的语法如下:
while expression:
suite_to_repeat
while 循环的 suite_to_repeat 子句会一直循环执行, 直到 expression 值为布尔假.
1、计数循环
a = 0 while a < 10: print a a += 1
2、break退出循环
while True: a = 0 print a if a = 9: break a += 1
标签:
原文地址:http://www.cnblogs.com/shetunxiang/p/4660081.html