三级菜单

 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

 

posted @ 2020-03-26 09:06  luoluokang  阅读(123)  评论(0编辑  收藏  举报