#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author;Tsukasa list_1 = {
'广州':{
'越秀区':{
'五羊石像','镇海楼','千年古道北京路'
},
'荔湾区':{
'荔枝湾','上下九步行街','陈家祠'
},
'海珠区':{
'云桂桥','琶洲塔','赤岗塔'
}
},
'佛山':{
'禅城区':{
'祖庙','梁园','岭南天地'
},
'南海区':{
'西樵山','南国桃园','千灯湖'
},
'顺德区':{
'陈村花卉世界','清晖园','西山庙'
}
},
'中山':{
'小榄':{
'龙山公园','水色匝','菊花会'
},
'石岐':{
'中山公园','西山寺','中山市博物馆'
},
'东区':{
'利和':['悦儿'],
'长江水库':['none'],
'紫马岭':['none'],
},
}
} while True:
for i in list_1:
print(i)
user_choice01 = input('1请选择进入>>>:')
if user_choice01 in list_1:
while True:
for i2 in list_1[user_choice01]:
print("\t",i2)
user_choice02 = input('2请选择进入>>>:')
if user_choice02 in list_1[user_choice01]:
while True:
for i3 in list_1[user_choice01][user_choice02]:
print('\t\t',i3)
user_choice03 = input('2请选择进入>>>:')
if user_choice03 in list_1[user_choice01][user_choice02]:
while True:
for i4 in list_1[user_choice01][user_choice02][user_choice03]:
print('\t\t\t',i4)
exit()

Python3 字典及三级菜单练习的更多相关文章

  1. (转)Python字典实现三级菜单

    Python字典实现三级菜单 原文:https://www.cnblogs.com/pyramid1001/p/5803294.html 1 ############################# ...

  2. Python字典实现三级菜单

    ################################################ # Task Name: 三级菜单 # # Description:打印省.市.县三级菜单 # # 可 ...

  3. Python学习笔记五:字符串常用操作,字典,三级菜单实例

    字符串常用操作 7月19日,7月20日 ,7月22日,7月29日,8月29日,2月29日 首字母大写:a_str.capitalize() 统计字符串个数:a_str.count(“x”) 输出字符, ...

  4. python 字典实现三级菜单

    简介:1.用字典建立一个省市县的三级菜单 2.开始显示所有的省份,输入要进入的省份之后,显示该省份下的所有市,输入市显示该市下的所有县 3.在每一级菜单下都可以返回到上一层菜单 4.随时可以退出 me ...

  5. python三级菜单的实现

    一.作业要求 1.使用字典实现三级菜单功能 2.直接输入前面数字进入下一级菜单 3.按B返回上一级,按Q退出 二.需要知识点 1.if循环 2.for循环,enumerate的用法 3.while循环 ...

  6. python3 实现一个多级菜单小功能

    记录下一下 #!/usr/bin/env python3 ''' 需求:三级菜单 三级菜单,依次进入子菜单 ''' City = { '北京':{ '大兴区':[ '亦庄','黄村','中信新城',' ...

  7. python三级菜单

    #-*- coding:utf-8 -*-#Author:gxli #一级菜单项def menu(): #遍历字典dic一级菜单 print('-----------一级菜单------------- ...

  8. python实现三级菜单源代码

    8月4号早晨天气晴,继续学习‘Alex’的python视频,写了用字典实现三级菜单的代码,都是循环和判断比较lower,废话不多说直接贴码: #!/user/bin/env python #-*-co ...

  9. python学习笔记(字符串操作、字典操作、三级菜单实例)

    字符串操作 name = "alex" print(name.capitalize()) #首字母大写 name = "my name is alex" pri ...

随机推荐

  1. 与http协作的web服务器、http首部(第五章、第六章)

    第五章 与http协作的web服务器 1.用单台虚拟主机实现多个域名 通过域名访问主机,经过DNS解析成ip地址,反向代理,可以代理多台服务器,正向代理则相反,代理客户端 2.通信数据转化程序:代理. ...

  2. Android中Handler导致的内存泄露

    http://www.androiddesignpatterns.com/2013/01/inner-class-handler-memory-leak.html Consider the follo ...

  3. 洛谷P2901 [USACO08MAR]牛慢跑Cow Jogging

    题目描述 Bessie has taken heed of the evils of sloth and has decided to get fit by jogging from the barn ...

  4. poj 1062 昂贵的聘礼 (dijkstra最短路)

    题目链接:http://poj.org/problem?id=1062 昂贵的聘礼 Time Limit: 1000MS   Memory Limit: 10000K Total Submission ...

  5. POJ1014(多重背包)

    Dividing Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 65044   Accepted: 16884 Descri ...

  6. python基础===8道基础知识题

    本文转自微信公众号: 2018-03-12 leoxin 菜鸟学Python 原文地址:http://mp.weixin.qq.com/s/JJSDv5YJOZ9e3hn28zWIsQ NO.1 Py ...

  7. 1006. Team Rankings

    Description It's preseason and the local newspaper wants to publish a preseason ranking of the teams ...

  8. C基础 一个可以改变linux的函数getch

    引言  -  getch简述 引用老的TC版本getch说明. (文章介绍点有点窄,  应用点都是一些恐龙游戏时代的开发细节) #include <conio.h> /* * 立即从客户端 ...

  9. C++ 流操作符重载函数

    1. 问题 在C++中,在进行输入输出操作时,我们首先会想到用cout, cin这两个库操作语句来实现,比如 cout << 8 << "hello world!&q ...

  10. 重写Alert

    var isIE = navigator.appName.indexOf("Internet Explorer") != -1;var oldAlert = window.aler ...