python_4

Posted taosun

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python_4相关的知识,希望对你有一定的参考价值。

三级菜单:

data={
‘Beijing‘:{
‘Changping‘:{
‘shahe1‘:[‘cook1‘,‘book1‘],
‘tiantongyuan1‘:[‘TV1‘,‘IPAD1‘]
},
‘Chaoyang‘:{
‘shahe2‘: [‘cook2‘, ‘book2‘],
‘tiantongyuan1‘:[‘TV1‘,‘IPAD1‘]
},
},
‘Jiangsu‘:{
‘Xuzhou‘:{
‘Suining‘:[‘goverment1‘,‘department1‘],
‘Tongshan‘:[‘goverment2‘,‘department2‘]
},
‘Nanjing‘: {
‘Liuhe‘: [‘goverment1‘, ‘department1‘],
‘Lishui‘: [‘goverment2‘, ‘department2‘]
},
},
}

exit_flag=False

while not exit_flag:
for i1 in data:
print(i1)
choice=input("choose1>>:")
if choice in data:
while not exit_flag:
for i2 in data[choice]:
print(" ",i2)
choice2=input("choose2>>:")
if choice2 in data[choice]:
while not exit_flag:
for i3 in data[choice][choice2]:
print(" ",i3)
choice3=input("choose3>>:")
if choice3 in data[choice][choice2]:
while not exit_flag:
for i4 in data[choice][choice2][choice3]:
print(" ",i4)
choice4=input("Press b to return the last level>>:")
if choice4 == "b":
break
elif choice4=="q":
exit_flag = True
if choice3 == "b":
break
elif choice3 == "q":
exit_flag = True
if choice2 == "b":
break
elif choice2 == "q":
exit_flag = True
elif choice == "q":
exit_flag = True

以上是关于python_4的主要内容,如果未能解决你的问题,请参考以下文章

13 个非常有用的 Python 代码片段

Android 逆向使用 Python 解析 ELF 文件 ( Capstone 反汇编 ELF 文件中的机器码数据 | 创建反汇编解析器实例对象 | 设置汇编解析器显示细节 )(代码片段

imgwarp.cpp:3143: error: (-215:Assertion failed) _src.total() > 0 in function ‘warpPerspective‘(代码片段

python小知识片段

python小知识片段

常用python日期日志获取内容循环的代码片段