码迷,mamicode.com
首页 > 其他好文 > 详细

小实验2:三级菜单

时间:2017-07-14 15:00:19      阅读:219      评论:0      收藏:0      [点我收藏+]

标签:ice   turn   code   实验   class   UI   log   ==   his   

# Author:Alano

city = {
    "tianjin":{
        "Hedong":{
            "shiyijinglu":{"1"},
            "ergong":{"2"},
            "haihe":{"3"},
        },
        "Hexiqu":{
            "meiling":{},
            "Meiguihuayuan":{},
            "TJtushuguan":{},
        },
        "Hebeiqu":{
            "nankoulu":{},
            "Xukai":{},
            "Zhangyi":{},
        },
        },
    "beijing":{},
    "Hebeisheng":{},
 }

while True:
    for i in city:
        print(i)
    choice = input("Do you want to go >>>")
    if choice in city:
        while True:
            for i2 in city[choice]:
                print(i2)
            choice2 = input("Do you want to go >>>")
            if choice2 in city[choice]:
                while True:
                    for i3 in city[choice][choice2]:
                        print(i3)
                    choice3 = input("Do you want to go >>>")
                    if choice3 in city[choice][choice2]:
                        for i4 in city[choice][choice2][choice3]:
                            print(i4)
                            choice4 = input("Turn Back set (q)>>>")
                            if choice4 == "q":
                                break
                    if choice3 == "q":
                        break
            if choice2 == "q":
                break
    if choice == "q":
        print("This is top!")

 

小实验2:三级菜单

标签:ice   turn   code   实验   class   UI   log   ==   his   

原文地址:http://www.cnblogs.com/xiapu5150/p/7169926.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!