博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
三级菜单小练习
阅读量:4576 次
发布时间:2019-06-08

本文共 1730 字,大约阅读时间需要 5 分钟。

跟着老师的,教程 重新敲了一遍代码

 

# Author:XFdata={    "上海":{        "浦东新区":{            "金桥":{                "爱法新城":{},                "文峰广场":{},                "金桥电脑城":{}            }        },        "杨浦区":{            "五角场":{                "个人电脑":{},                "颐高数码":{}            }        }    },    "新疆":{        "巴州":{            "库尔勒":{                "塔里木":{},                "尉犁县":{},                "若羌":{}            }        },        "生产建设兵团":{            "农二师":{                "32团":{},                "33团":{}            }        }    }}exit_flag=Falsewhile 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

  

转载于:https://www.cnblogs.com/mayixb/p/7376589.html

你可能感兴趣的文章
报文格式【定长报文】
查看>>
RDLC报表钻取空白页问题
查看>>
多路电梯调度的思想
查看>>
jQuery-对Select的操作
查看>>
过滤器、监听器、拦截器的区别
查看>>
为什么要进行需求分析?通常对软件系统有哪些需求?
查看>>
一些模板
查看>>
jquery和dom元素相互转换
查看>>
放大的X--HDOJ-201307292012
查看>>
题目831-签到-nyoj-20140818
查看>>
百词斩-斩家秘籍
查看>>
Mysql主从配置,实现读写分离
查看>>
完整版本的停车场管理系统源代码带服务端+手机android客户端
查看>>
HTML标签(二)
查看>>
在weblogic下运行Python脚本
查看>>
短信开发技术总结--协议篇
查看>>
HashMap实现原理分析
查看>>
私有类方法
查看>>
java网络编程Socket通信详解
查看>>
为什么使用Nosql:Nosql和SQL的区别
查看>>