1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
area = {
'广东' :{
'揭阳' :{
'普宁' :{
'里湖' ,
'梅塘' ,
'流沙'
},
'洪阳' :{ '1' , '2' },
'揭西' :{ '1' , '2' }},
'深圳' :{ '1' , '2' },
'广州' :{ '1' , '2' }
},
'北京' :{ '1' , '2' },
'四川' :{ '1' , '2' }
}
while True :
for i in area:
print (i)
choose = input ( "请选择省份:" )
if choose in area:
while True :
for i2 in area[choose]:
print (i2)
choose1 = input ( "请选择城市:" )
if choose1 in area[choose]:
while True :
for i3 in area[choose][choose1]:
print (i3)
choose2 = input ( "请选择县:" )
if choose2 in area[choose][choose1]:
for i4 in area[choose][choose1][choose2]:
print (i4)
while True :
choose3 = input ( "输入'b'可返回: " )
if choose3 = = 'b' :
break
elif choose2 = = 'q' :
exit( "Thankyou for use" )
elif choose2 = = 'b' :
break
elif choose1 = = 'q' :
exit( "Thankyou for use" )
elif choose1 = = 'b' :
break
elif choose = = 'q' :
exit( "Thank you foruse" )
|
本文转自 周子琪 51CTO博客,原文链接:http://blog.51cto.com/izhouyu/1964447