三级菜单退出

退到上一级,全部退出。

tag = True
while tag:
    choice = input('level_1>>').strip()
    if choice == 'quit': break
    if choice == 'qa': tag = False
    while tag:
        choice = input('level_2>>').strip()
        if choice == 'quit': break
        if choice == 'qa': tag = False
        while tag:
            choice = input('level_3>>').strip()
            if choice == 'quit': break
            if choice == 'qa': tag = False

猜你喜欢

转载自blog.csdn.net/bus_lupe/article/details/84670500