# !/usr/bin/env python # -*- coding:utf-8 -*- # Author:Hugolinhj data = { 'A':{ 'Aa':{ 'Aa1':{'oldboy':'test'}, 'Aa2':{'lianjiadichan':'woaiwojia'} }, 'Ab':{ 'Ab1':{'bengchi':'momo'}, 'Ab2':{'CICC':'HP'}, 'Ab3':{'Advent':'feixin'}, }, }, 'B':{ 'Ba':{ 'Ba1':{'Ba11':'Ba12'} }, 'Bb':{ 'Bb1':{'Bb11':'Bb12'}, 'Bb2':{'Bb21':'Bb212'}, }, 'Bc':{ 'Bc1': {'Bc11': 'Bc12'}, 'Bc2': {'Bc21': 'Bc212'}, }, }, 'c':{ 'Ca':{ 'Ca1':{'Ca11':'Ca12'}, 'Ca2':{'Ca21':'Ca12'}, }, 'Cb':{ 'Cb1': {'Cb11': 'Cb12'}, 'Cb2': {'Cb21': 'Cb12'}, }, 'Cc':{ 'Cc1': {'Cc11': 'Cc12'}, 'Cc2': {'Cc21': 'Cc12'}, }, }, } test = False while not test: for i in data: print(i) choise = input('choise>>>') if choise in data: while not test: for i2 in data[choise]: print('\t',i2) choise2 = input('choise>>>') if choise2 in data[choise]: while not test: for i3 in data[choise][choise2]: print('\t', i3) choise3 = input('choise>>>') if choise3 in data[choise][choise2]: while not test: for i4 in data[choise][choise2][choise3]: print('\t',i4) choise4 = input('choise>>>') if choise4 in data[choise][choise2][choise3]: for i5 in data[choise][choise2][choise3][choise4]: print('\t', i5) elif choise4 == 'q': break elif choise4 == 'e': quit() else: print('你输入的有误!请重新输入') elif choise3 == 'e': quit() elif choise3 == 'q': break else: print('你输入的有误!请重新输入') elif choise2 == 'e': exit() elif choise2 == 'q': break else:print('你输入的有误!请重新输入') elif choise == 'e': exit() elif choise == 'q': break else: print('你输入的有误!请重新输入')
Python No.16_练习(三级菜单选择)
转载本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
代码练习,三级菜单
1# -*- coding:utf-8 -*-menu = { '北京': { '海淀': { &nb
老男孩练习 三级菜单 Python练习 -
三级菜单
三级菜单
三级菜单 51cto -
Python学习三级菜单
python
Python学习 -
python 写三级菜单
# -*- coding: utf-8 -*-__author__ = 'am_mm_NO.1'import rememu = { "东北":{ "吉林省":{
python 初步流程控制实现按用户选择 在每一级都可以返回上级或退出程序。 -
java后台修改密码需要显示密码吗
java web项目总文档目录第一章 概述.................................................................................................................................... 1  
java后台修改密码需要显示密码吗 java 数据库 javascript ViewUI