#第一个案例==> while循环体
count = 1
while count <= 8 :
    print("这是第",count,"次")
    count = count + 1
#第二个案例==> break的使用
string = ""
while True :
    s = input("输入你想输入的内容:")
    if s == "q":
        break
    string += s
print(string)
#第三个案例 ==> continue的使用
string = ""
while True:
    s = input("输入你想输入的内容:")
    if(s == "q"):
        break
    if "abc" in s : #如果在输入的内容中有abc就不要加入待打印的字符串中
        continue
    string += s
print(string)
原文:https://www.cnblogs.com/boost/p/13228545.html