列表

#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





转载于:https://www.cnblogs.com/gejian1991/p/8372609.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值