标签:练习 nbsp 教程 blog div 浦东 新疆 bre for
跟着老师的,教程 重新敲了一遍代码
# Author:XF data={ "上海":{ "浦东新区":{ "金桥":{ "爱法新城":{}, "文峰广场":{}, "金桥电脑城":{} } }, "杨浦区":{ "五角场":{ "PC大佬个人电脑":{}, "颐高数码":{} } } }, "新疆":{ "巴州":{ "库尔勒":{ "塔里木":{}, "尉犁县":{}, "若羌":{} } }, "生产建设兵团":{ "农二师":{ "32团":{}, "33团":{} } } } } exit_flag=False while not exit_flag: for s1 in data: print(s1) select1=input("请选择:") if select1 in data: while not exit_flag: for s2 in data[select1]: print("\t", s2) select2 = input("请选择:") if select2 in data[select1]: while not exit_flag: for s3 in data[select1][select2]: print("\t\t", s3) select3 = input("请选择:") if select3 in data[select1][select2]: for s4 in data[select1][select2][select3]: print(s4) select4 = input("程序已经到了最后一层") if select4 == "b": pass if select4=="q": exit_flag=True if select3=="b": break if select3 == "q": exit_flag = True if select2=="b": break if select2 == "q": exit_flag = True if select1 == "q": exit_flag = True
标签:练习 nbsp 教程 blog div 浦东 新疆 bre for
原文地址:http://www.cnblogs.com/mayixb/p/7376589.html