python的学习笔记/002-5.1(2018-5-21)
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python的学习笔记/002-5.1(2018-5-21)相关的知识,希望对你有一定的参考价值。
还需要修改
_3_food_list={
‘主食‘:{
‘米饭‘:{
‘大米饭‘:["大份","中份","小份"],
‘小米饭‘:["大份","中份","小份"]
},
‘面食‘:{‘面‘:["大份","中份","小份"],
‘炒面‘:["大份","中份","小份"],
‘拌面‘:["大份","中份","小份"]
}
},
‘锅类‘:{
‘荤锅‘:{
‘海带排骨锅‘:["大锅","中锅","小锅"],
‘辣牛肉锅‘:["大锅","中锅","小锅"]
},
‘素锅‘:{
‘豆腐锅‘:["中锅","小锅"],
‘珍珠翡翠白玉锅‘:["大锅","中锅","小锅"]
}
},
‘饮品‘:{
‘奶茶‘:{
‘原味奶茶‘:["热","加冰"],
‘草莓奶茶‘:["热","加冰"]
},
‘饮料‘:{
‘可口可乐‘:["大杯","中杯"],
‘红牛‘:["大杯","中杯"]
}
}
}
exit_flag=False
while not exit_flag :
for i in _3_food_list:
print(i)
choice1=input(">>>please input 1:")
while not exit_flag:
if choice1 in _3_food_list:
for i in _3_food_list[choice1]:
print(i)
choice2=input("\t>>>please input 2:")
if choice2 in _3_food_list[choice1]:
for i in _3_food_list[choice1][choice2]:
print(i)
choice3=input("\t\t>>>please input 3 :")
while not exit_flag:
if choice3 in _3_food_list[choice1][choice2]:
for i in _3_food_list[choice1][choice2][choice3]:
print(i)
choice4=input("\t\t\t>>>please iput 4 :")
if choice4 in _3_food_list[choice1][choice2][choice3]:
print(choice4 )
choice5=input(">>>the last back(b):")
if choice5==‘b‘:
pass
elif choice5==‘q‘:
exit_flag =True
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
if choice1 == ‘b‘:
break
elif choice1 == ‘q‘:
exit_flag = True
以上是关于python的学习笔记/002-5.1(2018-5-21)的主要内容,如果未能解决你的问题,请参考以下文章