1 # -*- coding:utf-8 -*- 2 3 data =https://www.cnblogs.com/sunnytomorrow/p/ { 4 "騰訊":{ 5 "LOL":{ 6 "上單":["諾手","劍姬","蠻王"], 7 "打野":["男槍","盲僧","卡茲克"] 8 }, 9 "CF":{ 10 "步槍":[], 11 "手槍":[], 12 "機槍":[] 13 }, 14 "王者":{ 15 "上單":["宮本","亞瑟","項羽"], 16 "打野":["李白","蘭陵王","韓信"], 17 "射手":["魯班","后裔"] 18 } 19 }, 20 "網易":{ 21 "游戲1" 22 } 23 } 24 25 exit_flag = False 26 while not exit_flag: 27 for i1 in data: 28 print(i1) 29 choice1 = input(">>>1:") 30 if choice1 in data: 31 while not exit_flag: 32 for i2 in data[choice1]: 33 print("\t",i2) 34 choice2 = input(">>>2:") 35 if choice2 in data[choice1]: 36 while not exit_flag: 37 for i3 in data[choice1][choice2]: 38 print("\t\t",i3) 39 choice3 = input(">>>3:") 40 if choice3 in data[choice1][choice2]: 41 for i4 in data[choice1][choice2][choice3]: 42 print(i4) 43 choice4 = input(">>>4:") 44 if choice4 == "b": 45 pass 46 elif choice4 == "q": 47 exit_flag = True 48 elif choice3 == "b": 49 break 50 elif choice3 == "q": 51 exit_flag = True 52 elif choice2 == "b": 53 break 54 elif choice2 == "q": 55 exit_flag = True 56 elif choice1 == "q": 57 exit_flag = True
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/143935.html
標籤:Python
上一篇:Python--編碼轉換
