Level 3 menu, can go to the next level, can retreat to the previous level
Date = {"1": {"one": {"111": ["A", "B"], "("): ["C", "D"],}, "12": { "121": ["E", "F"], "122": ["G", "H"]}}, "2": {}, "3": {}}exit_flag = Falsewhile No T exit_flag:for i in Date:print (i) Choice = input ("SELECT INTO 1>>:") If choice in Date:while not Exit_flag:for i2 in Date[choice]: print ("\ T", i2) Choice2 = input ("SELECT INTO 2>>:") If Choice2 in Date[choice]: And not exit_flag:for i3 in Date[choice][choice 2]: Print ("\t\t", i3) Choice3 = input ("Select Enter 3>>:") if Cho Ice3 in Date[choice][choice2]: for I4 in Date[choice][choice2][choice3]: Print ("\t\t", i4) Choice4 = input ("Last layer, press B to return >>:") if Choice4 = = "B": Pass Elif Choice4 = = "Q": Exit_flag = True if Choi Ce3 = = "B": break elif Choice3 = = "Q": Exit_flag = True if Choice2 = = "B": break elif Choice2 = = "Q": Exit_flag = True
Python Topic 2: Multi-layered menus, entry and exit (dictionary)