Firs week-Homework(三级菜单)
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Firs week-Homework(三级菜单)相关的知识,希望对你有一定的参考价值。
要求:
- 三级菜单
- 可依次选择进入各子菜单,并且可以退出
Code:
1 #Author:Daniel 2 # -*- conding: utf-8 -*- 3 #time:2017.10.28-16:49 4 LOL = { 5 ‘LPL‘:{ 6 ‘RNG‘:{ 7 ‘Top‘:[‘Letme‘], 8 ‘Jun‘:[‘Mlxg‘], 9 ‘Mid‘:[‘Xiaohu‘], 10 ‘Adc‘:[‘Uzi‘], 11 ‘Sup‘:[‘Ming‘], 12 }, 13 ‘EDG‘:{ 14 ‘Top‘:[‘Mouse‘], 15 ‘Jun‘:[‘Clearlove7‘], 16 ‘Mid‘:[‘Souct‘], 17 ‘Adc‘:[‘Iboy‘], 18 ‘Sup‘:[‘Meiko‘], 19 }, 20 ‘We‘:{ 21 ‘Top‘: [‘957‘], 22 ‘Jun‘: [‘Condi‘], 23 ‘Mid‘: [‘Xiye‘], 24 ‘Adc‘: [‘Mysitc‘], 25 ‘Sup‘: [‘Zero‘], 26 }, 27 }, 28 ‘LCK‘:{ 29 ‘SKT‘:{ 30 ‘Top‘: [‘Huni‘], 31 ‘Jun‘: [‘Blank‘], 32 ‘Mid‘: [‘Faker‘], 33 ‘Adc‘: [‘Bang‘], 34 ‘Sup‘: [‘Wolf‘], 35 }, 36 ‘Samsung‘:{ 37 ‘Top‘: [‘Semb‘], 38 ‘Jun‘: [‘Kakao‘], 39 ‘Mid‘: [‘Crown‘], 40 ‘Adc‘: [‘Prioy‘], 41 ‘Sup‘: [‘Madlife‘], 42 }, 43 ‘KT‘:{ 44 ‘Top‘: [‘Mrain‘], 45 ‘Jun‘: [‘Dandy‘], 46 ‘Mid‘: [‘Pown‘], 47 ‘Adc‘: [‘Deft‘], 48 ‘Sup‘: [‘Mata‘], 49 }, 50 }, 51 ‘LCS‘:{ 52 ‘FNC‘:{ 53 ‘Top‘: [‘Soaz‘], 54 ‘Jun‘: [‘Amazing‘], 55 ‘Mid‘: [‘Caps‘], 56 ‘Adc‘: [‘Rekkles‘], 57 ‘Sup‘: [‘Jesiz‘], 58 }, 59 ‘TSM‘:{ 60 ‘Top‘: [‘Hauntzer‘], 61 ‘Jun‘: [‘Svenskeren‘], 62 ‘Mid‘: [‘Bjergsen‘], 63 ‘Adc‘: [‘Biofrost‘], 64 ‘Sup‘: [‘Yellowstar‘], 65 }, 66 ‘G2‘:{ 67 ‘Top‘: [‘Expect‘], 68 ‘Jun‘: [‘Loulex‘], 69 ‘Mid‘: [‘Perkz‘], 70 ‘Adc‘: [‘Zven‘], 71 ‘Sup‘: [‘Mithy‘], 72 }, 73 } 74 } 75 #print(LOL[‘LCK‘]) 76 77 while True: 78 for LOL_list in LOL: 79 print(LOL_list) 80 LOL_choice_1 = input(‘Please enter the area you want to see:‘) 81 #break 82 if LOL_choice_1 in LOL: 83 while True: 84 for LOL_list_2 in LOL[LOL_choice_1]: 85 print(‘\t‘,LOL_list_2) 86 LOL_choice_2 = input(‘Please enter the group you want to see:‘) 87 if LOL_choice_2 in LOL[LOL_choice_1]: 88 while True: 89 for LOL_list_3 in LOL[LOL_choice_1][LOL_choice_2]: 90 print(‘\t‘, ‘\t‘,LOL_list_3) 91 LOL_choice_3 = input(‘Please enter the location you want to see:‘) 92 if LOL_choice_3 in LOL[LOL_choice_1][LOL_choice_2]: 93 while True: 94 for LOL_list_4 in LOL[LOL_choice_1][LOL_choice_2][LOL_choice_3]: 95 print(‘\t‘,‘\t‘,‘\t‘,LOL_list_4) 96 LOL_choice_4 = input(‘The last layer exits by b:‘) 97 if LOL_choice_4 == ‘b‘: 98 break 99 elif LOL_choice_3 == ‘b‘: 100 break 101 else: 102 print(‘Input error,Please re-enter‘) 103 elif LOL_choice_2 == ‘b‘: 104 break 105 else: 106 print(‘Input error,Please re-enter‘) 107 elif LOL_choice_1 == ‘b‘: 108 break 109 else: 110 print(‘Input error,Please re-enter‘)
以上是关于Firs week-Homework(三级菜单)的主要内容,如果未能解决你的问题,请参考以下文章