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)