Python---Level three menu

Source: Internet
Author: User

Level three menu, compare low level, subsequent learning function call

1 #-*-coding:utf-8-*-2 #LC3data = {4     "Zhejiang province":{5         "Hangzhou City":{6             "West L. District":["West Lake","Huanglong"],7             "Yuhang":["Xixi Silver Thai","Busy Lake"],8             "Bingjiang District":["Avenue of Fame","Garbage Street"]9         },Ten         "Wenzhou":{ One             "Ouhai":["Wenzhou University","Cha Shan"], A             "Cangnan":["Jinxiang","Ling Xi"] -         }, -         "Taizhou":{ the             "Luqiao":["Seafood","Sprayer"], -             "Wenling":["Takayama","Green leaves"] -         } -     }, +     "Guangdong province":{ -         "Guangzhou" +     } A } at  -Exit_flag =True -  -  whileExit_flag: -      forIinchData: -         Print(i) inChoice = input ("Please select 1>>>:")#Select Province -     ifChoiceinchData: to          whileExit_flag: +              forJinchData[choice]: -                 Print(j) theChoice2 = input ("Please select 2, return to the previous level please press B, exit please press Q>>>:")#Select City *             ifChoice2inchData[choice]: $                  whileExit_flag:Panax Notoginseng                      forKinchData[choice][choice2]: -                         Print(k) theChoice3 = input ("Please select 3, return to the previous level please press B, exit please press Q>>>:")#Selection Area +                     ifChoice3inchData[choice][choice2]: A                          forLinchData[choice][choice2][choice3]: the                             Print(L) +Choice4 = input ("last layer, go back to the previous level, press B, exit please press Q>>>:") -                         ifChoice4 = ="b": $                              Break $                         elifChoice4 = ="Q": -Exit_flag =False -                     elifChoice3 = ="b":#If you choose to return, this cycle is interrupted the                          Break -                     elifChoice3 = ="Q":#If you choose to exit, change the loop value to False, end all loops, exitWuyiExit_flag =False the                     Else: -                         Print("wrong choice, re-enter! ") Wu                         Continue -             elifChoice2 = ="b": About                  Break $             elifChoice2 = ="Q": -Exit_flag =False -             Else: -                 Print("wrong choice, re-enter! ") A                 Continue

Python---Level three menu

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.