循环控制条件:
while 循环,分计数循环和无限循环。
计数循环:
#coding:utf-8
i = 0
while i <10:
i+=1
print i,
无限循环:
#coding:utf-8
i = 0
while True:
i +=1
if i ==7:
continue
print i,
if i >9:
break
无限循环中,做标记(flag)是常用的:
#coding:utf-8
flag = True
i = 0
while flag:
i +=1
print i,
if i>9:
flag = False