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

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

import sys

def _exit():
sys.exit('退出程序')
for d in data:
print(d)
while True:
choice=input('输入你要查询的内容:')
if choice in data:
while True:
for d1 in data[choice]:
print(d1)
choice1 = input('输入你要查询的漫画:')
if choice1 in data[choice]:
while True:
for d2 in data[choice][choice1]:
print(d2)
choice2 = input('输入你要查看的人物:')
if choice2 in data[choice][choice1]:
while True:
for d3 in data[choice][choice1][choice2]:
print(d3)
choice3 = input('输入你想看的选项:')
if choice3 in data[choice][choice1][choice2]:
for d4 in data[choice][choice1][choice2][choice3]:
print(d4)
print('是否继续查询: q退出')
user_gone = input('请输入您的选择:')
if user_gone != 'q':
pass
else:
pass
elif choice3 == '':
print('输入不能为空')
elif choice3 == 'q':
_exit()
elif choice3 == 'b':
break
else:
print('该选项不存在')

elif choice2 == '':                    print('输入不能为空')                elif choice2 == 'q':                    _exit()                elif choice2 == 'b':                    break                else:                    print('查询内桶不存在')        elif choice1 =='':            print("输入不能为空")        elif choice1 =='q':            _exit()        elif choice1 == 'b':            break        else:            print('查找内容不存在')elif choice == '':    print('查询内容不能为空')elif choice =='q':    _exit()elif choice == 'b':    breakelse:    print('查询内容不存在')

转载于:https://blog.51cto.com/13965173/2173976

你可能感兴趣的文章
让oracle做定时任务【转】
查看>>
qt5 make 找不到QApplication
查看>>
关闭或开启memory_target
查看>>
100c之36:不同鸡的数量
查看>>
数据库对数字不限长度的冒泡排序
查看>>
slice切割数组arr=[[0,1],[2,3]]
查看>>
linux自动ftp上传与下载文件的简单脚本
查看>>
❀❀ selenium 学习网站 ★★★★★
查看>>
Navicat 安装+连接
查看>>
正则的扩展
查看>>
springmvc数据校验
查看>>
嘴皮子
查看>>
swoole知识点
查看>>
配置文件与网站部署
查看>>
mvn -U clean eclipse:clean eclipse:eclipse
查看>>
windows下安装composer抛出Composer\Downloader\TransportException异常解决办法
查看>>
HTTP协议简单介绍
查看>>
js&&node set_cookie、get_cookie
查看>>
定义一个数组返回最大子数组的值(2)
查看>>
a:active
查看>>