Implementation of level three menus (Python program)

Source: Internet
Author: User

This is just beginning to write the program, the three-level menu program is basically a dictionary implementation, very low, after learning other better things, I will continue to upload, and then strive for in my level of advanced, the simple things to achieve the ruthless tall on.

_author_ ="Zhanzhengrecheng"Data={    "Shaanxi":{        "Baoji":{"Fufeng County":["Duan Jia Zhen","Cheng Guan"],},        "Weinan":{},        "Yanan":{},        "Xian":{},        },    "Hebei":{        "Baoding":{"Tang County":["Yang Zhuang","Huang Zhuang"]},        "Shijiazhuang":{},        "Tangshan":{},        "Hengshui": {},},}exit_flag=False while  notExit_flag: forI1inchData:Print(i1) Choice1= Input ("choose to enter 1111>>:")    ifChoice1inchData: while  notExit_flag: forI2inchData[choice1]:Print("\ t", I2) Choice2= Input ("choose to enter 2222>>:")            ifChoice2inchData[choice1]: while  notExit_flag: fori3inchData[choice1][choice2]:Print("\t\t", i3) Choice3= Input ("choose to enter 3333>>:")                    ifChoice3inchData[choice1][choice2]: forI4inchData[choice1][choice2][choice3]:Print("\t\t\t", I4) Choice4= Input ("last layer, press B to return")                        ifChoice4 = ="b":                             Pass                        elifChoice4 = ="Q": Exit_flag=TrueifChoice3 = ="b":                         Break                    elifChoice3 = ="Q": Exit_flag=TrueifChoice2 = ="b":                 Break            elifChoice2 = ="Q": Exit_flag= True

Not yet ready to add .....

Implementation of level three menus (Python program)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.