zoukankan      html  css  js  c++  java
  • 第一章--三级菜单作业

    #_*_coding:utf-8_*_
    menu = {
    '北京':{
    '海淀':{
    '五道口':{
    'soho':{},
    '网易':{},
    'google':{}
    },
    '中关村':{
    '爱奇艺':{},
    '汽车之家':{},
    'youku':{}
    },
    '上地':{
    '百度':{},

    },

    },
    '昌平':{
    '沙河':{
    '老男孩':{},
    '北航':{},
    },

    },
    '天通苑':{},
    '回龙观':{},

    },
    '上海':{
    '闵行':{},
    '闸北':{
    '火车站':{
    '携程':{},

    },
    }
    },
    '浦东':{},
    },


    while True:
    for k in menu:
    print(k)
    choice = input(">:").strip
    if not choice:continue
    if choice in menu:
    while True:
    for k in menu[choice]:
    print(k)
    choice2=input(">>:").strip()
    if not choice2: continue
    if choice2 in menu[choice]:
    while True:

    for k in menu[choice][choice2]:
    print(k)
    choice3 = input(">>>:").strip()
    if not choice3:continue
    if choice3 in menu[choice][choice2]:
    print("go to ,",menu[choice] [choice2] [choice3])
    else:
    print("节点不存在")


    else:
    print("节点不存在")






  • 相关阅读:
    微信小程序
    svn
    当滑动条滑动到某一位置触发js
    css固定页面
    css三级菜单
    h5时钟
    DOM节点
    应用r.js来优化你的前端
    浅谈javascript中的作用域
    javascript 中的 arguments,callee.caller,apply,call 区别
  • 原文地址:https://www.cnblogs.com/anzhangjun/p/8472601.html
Copyright © 2011-2022 走看看