tag的使用
tag = True
while tag:print("level")choice = input("level>>>").strip() #作用是暫停 不會一直死循環if choice == "quit":break #終止當前循環進入到上一層if choice == "quit_all": tag = False #不用一層層退出 直接退出整個循環while tag:print("level2")choice = input("leve2>>>").strip()if choice == "quit": breakif choice == "quit_all": tag = Falsewhile tag:choice = input("leve3>>>").strip()if choice == "quit": breakif choice == "quit_all": tag = False
?
轉載于:https://www.cnblogs.com/newt/p/9022840.html
總結
- 上一篇: C++primer习题--第1章
- 下一篇: 把base64转为blob