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':
break
else:
print('查询内容不存在')