china_map
=
{
"华南"
:{
"广东"
:[
"广州市"
,
"佛山市"
,
"深圳市"
,
"东莞市"
],
"广西"
:[
"南宁市"
,
"柳州市"
,
"桂林市"
,
"北海市"
],
"海南"
:[
"海口市"
,
"三亚市"
,
"三沙市"
,
"儋州市"
]
},
"华东"
:{
"上海"
:[
"黄浦区"
,
"卢湾区"
,
"徐汇区"
,
"长宁区"
,
"普陀区"
],
"安徽"
:[
"合肥市"
,
"芜湖市"
,
"淮南市"
,
"马鞍山市"
],
"江苏"
:[
"南京市"
,
"无锡市"
,
"徐州市"
,
"常州市"
,
"苏州市"
]
},
"华北"
:{
"北京"
:[
"东城区"
,
"西城区"
,
"朝阳区"
,
"丰台区"
,
"石景山区"
,
"海淀区"
],
"山西"
:[
"太原市"
,
"大同市"
,
"阳泉市"
,
"长治市"
],
"河北"
:[
"石家庄市"
,
"唐山市"
,
"秦皇岛市"
,
"邢台市"
]
},
"华中"
:{
"湖北"
:[
"武汉市"
,
"黄石市"
,
"十堰市"
,
"十堰市"
],
"河南"
:[
"郑州市"
,
"开封市"
,
"洛阳市"
,
"平顶山市"
],
"湖南"
:[
"长沙市"
,
"株洲市"
,
"衡阳市"
,
"邵阳市"
]
},
"西南"
:{
"重庆"
:[
"万州区"
,
"涪陵区"
,
"渝中区"
,
"大渡口区"
],
"四川"
:[
"成都市"
,
"自贡市"
,
"攀枝花市"
,
"德阳市"
],
"贵州"
:[
"贵阳市"
,
"六盘水市"
,
"遵义市"
,
"安顺市"
],
},
"特别行政区"
:{
"香港"
:[
"屯门"
,
"弯仔"
,
"北角"
,
"西贡"
],
"澳门"
:[
"花地玛堂区"
,
"圣安多尼堂区"
,
"大堂区"
,
"望德堂区"
],
},
}
print
(
"-------------------------------------------------"
)
print
(
"+ +"
)
print
(
"+ +"
)
print
(
"+ 欢迎来到大中华地区查询系统地 +"
)
print
(
"+ +"
)
print
(
"+ +"
)
print
(
"-------------------------------------------------"
)
print
(
"大中华地区一级划分:"
)
for
i
in
china_map:
print
(i)
print
(
"-------------------------------------------------"
)
jump_flag
=
False
for
i
in
range
(
3
):
greater_china_name
=
input
(
"请输入你要查看的大中华地区名字:"
)
if
greater_china_name
in
china_map:
gc_name
=
china_map[greater_china_name]
province_name
=
gc_name.keys()
while
True
:
print
(
"------------------包含的省名字二级:-----------------"
)
for
i
in
province_name:
print
(i)
print
(
"-------------------------------------------------"
)
sheng_name_input
=
input
(
"请输入你要查看的省名字:"
)
if
sheng_name_input
in
province_name:
shi_name
=
china_map[greater_china_name][sheng_name_input]
print
(
"--------------包含的城市名三级:-------------------"
)
for
i
in
shi_name:
print
(i)
print
(
"------------------------------------------------"
)
if
sheng_name_input
not
in
province_name:
print
(
"输入的省名字不对,请重新输入"
)
continue
back_or_quit
=
input
(
"请问是否退出?按b:Back是返回上一级菜单;按q:Exit是退出整个程序"
)
if
back_or_quit
=
=
"q"
:
jump_flag
=
True
break
if
back_or_quit
=
=
"b"
:
continue
print
(
"你输入的信息有误,请重新输入"
)
if
jump_flag:
break
else
:
print
(
"3次输入错误,程序退出"
)