1. 程式人生 > >一個python程序

一個python程序

日常

date = {
‘北京‘:{
"昌平":{
"沙河": ["old boy", "test"],
"天通苑":["鏈家地產","我愛我家"]
},
"朝陽":{
"望京":["奔馳","陌陌"],
"國貿":["CICC","HP"],
"東直門":["Adevent","飛信"]
},
"海澱":{},
},
‘山東‘:{
"德州":{},
},
‘廣東‘:{
"東莞":{},
"常熟":{},
"佛山":{},
},
}

exit_flag = False
while not exit_flag:
for i in date:
print(i)
choice = input("選擇進入1>>:")
if choice in date:
while not exit_flag:
for i2 in date[choice]:
print("\t",i2)
choice2 = input("選擇進入2>>:")

if choice2 in date[choice]:
while not exit_flag:
for i3 in date[choice][choice2]:
print("\t\t",i3)
choice3 = input("選擇進入3>>:")
if choice3 in date[choice][choice2]:
for i4 in date[choice][choice2][choice3]:
print("\t\t",i4)
choice4 = input("最後一層,按b返回>>:")
if choice4 == "b":
pass
elif choice4 == "q":
exit_flag = True技術分享圖片

一個python程序