标签:inpu break ddr 我爱我家 省份 lag for 陌陌 add
#1:省份数列:
data = {
"北京":{
"昌平":{
"沙河":["oldboy","电信"],
"银河":[ "链家地产","我爱我家"]
},
"朝阳":{
"望京":["奔驰","陌陌"],
"东直门":["飞信","HP"]
},
"海淀":{
"test1":[‘address311‘,‘address312‘],
"test2":[‘address321‘,‘addrress322‘]
}
},
"广东":{
"东莞":{
"address201":["address311","address312"],
"address202":["address321","address322"]
},
"梅州":{
"maddress201":["maddress301","maddress302"],
"maddress202":["maddress311","maddress312"]
}
},
"广西":{
"百色":{
"Baddress201":["Baddress301","Baddress302"],
"Baddress202":["Baddress311","Baddress312"]
},
"南昌":{
"NBaddress201":["Naddress301","Naddress302"],
"N2Baddress212":["NBaddress311","Naddress312"]
}
}
}
exit_flag= False
while not exit_flag:
for i in data:
print(i)
choice = input("请输入地址进入下一级菜单:")
if choice in data:
while not exit_flag:
for i2 in data[choice]:
print("\t",i2)
choice2 = input("请输入地址进入下一级菜单,按r键返回上一级菜单:")
if choice2 in data[choice]:
while not exit_flag:
for i3 in data[choice][choice2]:
print ("\t\t",i3)
choice3 = input("请输入地址进入下一级菜单,按r键返回上一级菜单:")
if choice3 in data[choice][choice2]:
while not exit_flag:
for i4 in data[choice][choice2][choice3]:
print ("\t\t",i4)
choice4 = input ("最后一层,按r返回上一级菜单:")
if choice4 == "r":
break
elif choice4 == "q":
exit_flag = True
elif choice3 == "r":
break
elif choice3 == "q":
exit_flag = True
if choice2 == "r":
break
elif choice2 == "q":
exit_flag = True
if choice == "r":
break
elif choice == "q":
exit_flag = True
标签:inpu break ddr 我爱我家 省份 lag for 陌陌 add
原文地址:http://www.cnblogs.com/liulvzhong/p/6420706.html