当前位置: 移动技术网 > IT编程>脚本编程>Python > day1_作业2(三级菜单)

day1_作业2(三级菜单)

2018年04月27日  | 移动技术网IT编程  | 我要评论

p57减肥胶囊,痞子英雄陈意涵,金沙国际找055118澳门官网

#!/usr/local/bin/python3
# -*- coding:utf-8 -*-
province={'江苏省':['南京市','苏州市','无锡市'],'浙江省':['杭州市','温州市','宁波市']}
city={'南京市':['秦淮区','玄武区','栖霞区'],'苏州市':['姑苏区','虎丘区','吴中区'],
      '无锡市':['滨湖区','惠山区','锡山区'],'杭州市':['西湖区','拱墅区','萧山区'],
      '温州市':['鹿城区','瓯海区','龙湾区'],'宁波市':['镇海区','海曙区','江北区']}
while True:
    print("hello,which province do you want to choose?")
    print("Here are the province_list:江苏省,浙江省")
    province_input=input("input:")
    if province_input in province:
        print('Here are the citys_list:',province[province_input])
        temp=input('Do you want return province_list? yes/no:')
        if temp=='yes':
            continue
        elif temp=='no':
            while True:
                city_input=input("choose the city:")
                if city_input in city:
                        print('Here are the towns_list:',city[city_input])
                        temp2 = input('Do you want return city_list? yes/no:')
                        if temp2=='yes':
                            continue
                        break
                else:
                    print('invaild input!')
        else:
            print('invaild input!')
    else:
        print('invaild input!')
    if temp2=='no':
        break

  

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网