三级菜单
1 tag = True 2 while tag: 3 print('第一级') 4 choice = input('l1: ').strip() 5 if choice == 'ko':break 6 if choice == 'ok':tag = False 7 8 while tag: 9 print('第二级') 10 choice = input('l2: ').strip() 11 if choice == 'ko':break 12 if choice == 'ok':tag = False 13 14 while tag: 15 print('第三极') 16 choice = input('l3: ').strip() 17 if choice == 'ko':break 18 19 if choice == 'ok':tag = False
Never compromise.