Old Boys Training and study:
1 " "2 AUTHOR:RANXF3 " "4menu = {5 'Beijing': {6 'Haidian': {7 'Five crossing': {8 'Soho': {},9 'NetEase': {},Ten 'Google': {} One }, A 'Zhongguancun': { - 'Iqiyi Art': {}, - 'Autohome': {}, the 'Youku': {}, - }, - 'on the ground': { - 'Baidu': {}, + }, - }, + 'changping': { A 'Shahe': { at 'old boy': {}, - 'Beihang University': {}, - }, - 'Tin Tong Court': {}, - 'Huilongguan': {}, - }, in 'Chaoyang': {}, - 'Dongcheng': {}, to }, + 'Shanghai': { - 'Minhang': { the "People's square": { * 'Fried Chicken Shop': {} $ }Panax Notoginseng }, - 'Zhabei': { the 'Train Warfare': { + 'Ctrip': {} A } the }, + 'Pudong': {}, - }, $ 'Shandong': {}, $ } -Exit_flag =False - the while notExit_flag: - forI1inchMenu:Wuyi Print(I1) the -Choice1 = input (">>> Select a menu 1>>>:") Wu ifChoice1inchMenu: - while notExit_flag: About forI2inchMenu[choice1]: $ Print("\ t", I2) - -Choice2 = input (">>> Select Level Two menu 2>>>:") - ifChoice2inchMenu[choice1]: A while notExit_flag: + fori3inchMenu[choice1][choice2]: the Print("\t\t", i3) - $Choice3 = input (">>> Select level Three menu 3>>>:") the ifChoice3inchMenu[choice1][choice2]: the forI4inchMenu[choice1][choice2][choice3]: the Print("\t\t", I4) theChoice4 = input (">>> last level menu, press B to return, press Q to exit >>>:") - ifChoice4 = ='b': in Pass the elifChoice1 = ='Q': theExit_flag =True About the ifChoice3 = ='b': the Break the elifChoice3 = ='Q': +Exit_flag =True - the ifChoice2 = ='b':Bayi Break the elifChoice2 = ='Q': theExit_flag =True - ifChoice1 = ='b': - Break the elifChoice1 = ='Q': theExit_flag = True
Python Instance 3-level three menu