menu = {
'北京':{
'海淀':{
'五道口':{
'soho':{},
'网易':{},
'google':{}
},
'中关村':{
'爱奇艺':{},
'汽车之家':{},
'youku':{},
},
'上地':{
'百度':{},
},
},
'昌平':{
'沙河':{
'老男孩':{},
'北航':{},
},
'天通苑':{},
'回龙观':{},
},
'朝阳':{},
'东城':{},
},
'上海':{
'闵行':{
"人民广场":{
'炸鸡店':{}
}
},
'闸北':{
'火车战':{
'携程':{}
}
},
'浦东':{},
},
'山东':{},
}
menu = {
"chengdu":
{"wuhou":
{"shuangnan","hongpailou"},
"shuangnan":
{"jule","gaoshengqiao"}
},
"nanchong":
{"yilong":
{"saijing", "fuxing"},
"yunshan":
{"sanxing", "lushui"}
}
}
# while True:
print menu
print "menu中有的市的名单:"
print menu.keys()
while True:
shi = raw_input("选中的市(Q/B)>>>")
if (shi.strip()).upper()=="Q":
break
elif (shi.strip()).upper()=="B":
continue
elif (shi.strip()).lower() not in menu.keys():
print "输入有误,请重新选择"
continue
else:
print menu[shi.strip()]
while True:
xian = raw_input("选中的区县(Q/B)>>>")
if (xian.strip()).upper() == "Q":
break
elif (xian.strip()).upper() == "B":
continue
elif (xian.strip()).lower() not in (menu[shi.strip().lower()]).keys():
print "输入有误,请重新选择"
continue
else:
print menu[shi.strip().lower()][xian]