首页 > 代码库 > 小实验2:三级菜单
小实验2:三级菜单
# 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:三级菜单
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。