#Author:ge jian
data = {
‘北京‘:{
‘昌平‘:{
‘沙河‘:[‘oldboy‘,‘test‘],
‘天通苑‘:[‘链家‘,‘我爱我家‘]
},
‘朝阳‘:{
‘望京‘:[‘奔驰‘,‘陌陌‘],
‘国贸‘:[‘CICC‘,‘HP‘],
},
}
}
exit_flag = False
while not exit_flag:
for i in data:
print(i)
choice = input(‘选择输入1》》:‘)
if choice in data:
while not exit_flag:
for j in data[choice]:
print(‘\t‘,j)
choice1 = input(‘选择输入2》》:‘)
if choice1 in data[choice]:
while not exit_flag:
for k in data[choice][choice1]:
print(‘\t\t‘, k)
choice2 = input(‘选择输入3》》:‘)
if choice2 in data[choice][choice1]:
for l in data[choice][choice1][choice2]:
print(‘\t\t‘,l)
choice3 = input(‘最后一行,按b退出‘)
if choice3==‘b‘:
pass
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
else:
exit_flag = True
python第五天
Posted gejian1991
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python第五天相关的知识,希望对你有一定的参考价值。
以上是关于python第五天的主要内容,如果未能解决你的问题,请参考以下文章