menu = {
'北京': {
'朝阳': {
'国贸': {},
'CICC': {},
'HP': {},
'渣打银行': {},
'CCTV': {},
},
'望京': {
'陌陌': {},
'奔驰': {},
'360': {},
},
'三里屯': {
'优衣库': {},
'apple': {},
},
'昌平': {
'沙河': {
'老男孩': {},
'阿泰包子': {},
},
'天通苑': {
'链家': {},
'我爱我家': {},
},
'回龙观': {},
},
'海淀': {
'五道口': {
'谷歌': {},
'网易': {},
'sohu': {},
'快手': {},
},
'中关村': {
'youku': {},
'Iqiyi': {},
'汽车之家': {},
'新东方': {},
'QQ': {},
},
},
},
'上海': {
'浦东': {
'陆家嘴': {
'CICC': {},
'高盛': {},
'摩根': {},
},
},
'闵行': {},
'静安': {},
},
'山东': {
'济南': {},
'德州': {
'乐陵': {
'丁务镇': {},
'城区': {},
},
'平原': {},
},
'青岛': {},
},
}
#
def threeLM(dic):
while True:
for k in dic:
print(k)
key =input('input>>>').strip()
if key =='b' or key=='q':
return key
elif key in dic.keys() and dic[key]:
ret = threeLM(dic[key])
if ret =='q':
return 'q'
threeLM(menu)
l =[menu]
while l:
for key in l[-1]:
print(key)
k =input('input>>').strip()
if k in l[-1].keys() and l[-1][k]:
l.append(l[-1][k])
elif k =='b':l.pop()
elif k =='q':break
else:continue