python三级菜单实例_Python中三级菜单选择进⼊各级菜单
(⽰例代码)
设置三级菜单,然后选择逐级打印内容,提⽰选择,最后⼀层提⽰返回上⼀层或者退出。
十八大看黄禁用免费app‘‘‘
三级菜单 选择进⼊各级
‘‘‘
chinaMenu = {
"菜谱⼤全":{
"家常菜谱":{
"家常菜":{"糖醋排⾻","红烧排⾻"},
"凉菜":{"⿇辣鸡丝","凉拌黄⽠"}
},
"各地⼩吃":{
"四川⼩吃":{"四川凉⾯","⿇辣⾹锅"},
"⼴东⼩吃":{"鲜虾肠粉","云吞⾯","⾁⾹糯⽶团"}
}
},
"健康饮⾷":{
"饮⾷健康":{
"家常菜":{"糖醋排⾻","红烧排⾻"},
"凉菜":{"⿇辣鸡丝","凉拌黄⽠"}
},
"⼈膳⾷":{
"孕妇":{"鸽⼦汤","红烧猪蹄"},
"产妇":{"猪脚姜","鲫鱼汤","猪蹄花⽣汤"}
php exit函数}
}
}
exit_flag = False
while not exit_flag:
for i in chinaMenu:
print(i)原码补码反码转换口诀
bigMenu = input("请输⼊需要进⼊的栏⽬:")
if bigMenu in chinaMenu:
while not exit_flag:
for i in chinaMenu[bigMenu]:
print(i)
smallMenu = input("请输⼊需要进⼊的栏⽬:")
rpm命令不到if smallMenu in chinaMenu[bigMenu]:
while not exit_flag:
for i in chinaMenu[bigMenu][smallMenu]:
print(i)
ultimateMenu = input("请输⼊需要进⼊的栏⽬:")
if ultimateMenu in chinaMenu[bigMenu][smallMenu]:
while not exit_flag:
for i in chinaMenu[bigMenu][smallMenu][ultimateMenu]:
print(i)
choice = input("已经最终栏⽬了,请输⼊B返回,如果需要退出请选择Q:") if choice == "B":
break
if choice == "Q":
exit_flag = True
springmvc+mybatisif ultimateMenu == "B":
break
if ultimateMenu == "Q":
exit_flag = True
if smallMenu == "B":
break
if smallMenu == "Q":
exit_flag = True
if bigMenu == "B":python基础代码大全下载
break
if bigMenu == "Q":
exit_flag = True
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论