• day1-作业2


    #!/usr/bin/env python
    # -*- coding: utf-8 -*-
    # Auther:tangnanbing

    dict1 = {
    "河北省":{
    "保定市":["蠡县","易县","安国县"],
    "石家庄市":["涿州县1","涿州县2","涿州县3"],
    "廊坊市":["大厂县","香河县","燕郊县"]
    },
    "山东省":{
    "德州市": ["平原县","吴桥县","东光县"],
    "青岛市": ["崂山区","李沧区","市北区"],
    "潍坊市": ["潍城区","寒亭区","安丘县"]
    },
    "山西省":{
    "太原市":["晋中县","交城县","阳曲县"],
    "忻州市":["原平县","定襄县","静乐县"],
    "朔州市":["山阴县","神池县","右玉县"]
    }
    }
    while True:
    print ("系统中存储的省份信息如下:")
    for provice_name in(dict1.keys()):
    print(provice_name)
    input_privice_name = input("请输入您说要查看的省:")
    if input_privice_name in (dict1.keys()):
    print("您所输入的省份下面有如下市:")
    for city_name in (dict1[input_privice_name]):
    print (city_name) ###### 打印市
    input_city_name = input("请输入您所要查看的市:")
    if input_city_name in (dict1[input_privice_name]):
    for country_name in (dict1[input_privice_name][input_city_name]):
    print(country_name)
    print("##############信息查看完毕,回到顶层##########")
    elif input_city_name == 'Q':
    continue
    else:
    print("您所输入的市不在所选省份下面,请正确输入")
    elif input_privice_name == "Q":
    exit()
    else:
    print("您所输入的省份在系统里不存在,请重新输入:")
  • 相关阅读:
    Https、SSL/TLS相关知识及wireShark抓包分析
    谷歌浏览器如何查看当前网页使用哪个TLS版本?
    centos7 ssh启动异常时,用ssh -t 查看报错信息。
    centos7设置久静态ip
    将cmder.exe添加到右键菜单,并配置环境变量
    KeepAlive与KeepAlive的区别
    openssl笔记
    1.javascript知识点总结
    js的小练习
    7.利用canvas和js画一个渐变的
  • 原文地址:https://www.cnblogs.com/Sunnynanbing/p/8158819.html
Copyright © 2020-2023  润新知