Python_example_ Multilevel Selection Program

Source: Internet
Author: User

2018-09-09

Author: Zug

ide:pycharm2018.02 Python 3.7

KeyWord: Dictionary

Explain:

Multistage selection, follow-up optimization

1-------------------------------------------------------------------------------------------------------------- ----



--
__author__="Chu Ge"#Key-valueData= {            "Europe":{                    "www.hsbc.com": ["Personal Banking","Insurance Investment","borrowing and credit cards"],                    "www.citibank.com": ["The most successful financial services group","Savings Trust Securities Insurance"],                    "www.jpmorganchase.com": ["A multinational financial services organization and the largest bank in the United States","Investment Management"],                    "www.deutsche.com": ["Germany's largest bank and the world's leading financial institution","the world's foremost financial institution"]                  },            "Japan and South Korea":{                    "bankofjapan.com":["Japan's largest financial institution","Personal Business"],                    "bankofhanya.com":["Korea's largest financial institution","Personal Business"]                  },            "Mainland":{                    "BOC":["ranked first","Savings Trust Securities Insurance"],                    "ICBC":["ranked second","Savings Trust Securities Insurance"],                    "CCB":["ranked third","Savings Trust Securities Insurance"],                    "ABC":["Ranked # Fourth","Savings Trust Securities Insurance"],                    "Cross-line":["Ranked # Fifth","Savings Trust Securities Insurance"]                  }        }Print("Bank:", data) data["Mainland"]["CCB"][1] ="Savings Trust Securities insurance, scattered currency"  #ModifyData.setdefault ("Mainland",{"www.baidu.com": []})Print("Bank:", data) Exit_flag=False while  notExit_flag:Print('----First Floor----')    #local_a = 0    #For i in data:    #local_a + = 1    #print (' ordinal%d%s '% (local_a,i))     forIndex, iteminchEnumerate (data):#enumerate the list subscript.        Print(Index, item)#Enumerate (data) Get subscriptindex1= Input ("choose to enter (content) 1 >>>:")    ifIndex1inchData: while  notExit_flag:#For I2 in data[index1]:            #print ("\ T", I2)             forIndex, iteminchEnumerate (Data[index1]):#enumerate the list subscript.                Print(Index, item)#Enumerate (data) Get subscriptIndex2= Input ("choose to enter 2 >>>:")            ifIndex2inchData[index1]: while  notexit_flag:local_a=0 fori3inchData[index1][index2]: local_a+ = 1Print('local_a:%d'%local_a,"\t\t", i3) index3= Input ("last layer, press B to return to >>:")                        ifIndex3 = ="b":                            Pass                        elifIndex3 = ="Q": Exit_flag=TrueifIndex2 = ="b":                 Break            elifIndex2 = ="Q": Exit_flag= True

--

----First Floor----0 Europe and the United States 1 Mainland 2nd Korea choose to enter (content) 1 >>>: Mainland 0 BOC 1 Agricultural Bank 2 CCB 3 ICBC 4 cross-line choice to enter 2 >>>: ICBC Local_a:1   ranked second last level, press B to return >>:

  

Python_example_ Multilevel Selection Program

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.