A logo can represent a certain operation (three complete menu and exit all cycles code)

#!/user/bin/python
# -*- coding:utf-8 -*-
tag = True
while tag:
print("leve1")
choice = input("level1>>:").strip()
if choice == "quit" : break
if choice == "quit_all" : tag = False
while tag:
print("level2")
choice = input("level2>>:").strip()
if choice == "quit" : break
if choice == "quit_all" : tag = False
while tag:
print("level3")
choice = input("level3>>:").strip()
if choice == "quit" : break
if choice == "quit_all":tag = False

Guess you like

Origin www.cnblogs.com/zhang-da/p/10981393.html