<pre id="vvttv"><mark id="vvttv"><progress id="vvttv"></progress></mark></pre>
    <pre id="vvttv"></pre>

      <p id="vvttv"></p>

          <p id="vvttv"></p>

                <p id="vvttv"></p>

                <pre id="vvttv"><cite id="vvttv"><progress id="vvttv"></progress></cite></pre>

                  <output id="vvttv"><dfn id="vvttv"><th id="vvttv"></th></dfn></output>

                    <p id="vvttv"></p>

                    ???? Python ???
                    ??9?? ?????
                    ???? ??? ????

                    ???

                    ???????????????????????????????????????????????????????????????????????????????????????????????????Ψ????????????????????????????????????????????????

                    ??????????ò?????????????????????????????????????????????????????????????????????????????????ü?????????????

                    ??????????????????????????d = {key1 : value1, key2 : value2 }???????????/?????e?????????????????????????Щ??????????????С?

                    ???????е??/???????????????????????????????????????????????????????????

                    ?????dict??????/????

                    ??????

                    ??9.4 ??????

                    #!/usr/bin/python
                    # Filename: using_dict.py

                    # 'ab' is short for 'a'ddress'b'ook


                    ab = {       'Swaroop'   : 'swaroopch@byteofpython.info',
                                 'Larry'     : 'larry@wall.org',
                                 'Matsumoto' : 'matz@ruby-lang.org',
                                 'Spammer'   : 'spammer@hotmail.com'
                         }

                    print "Swaroop's address is %s" % ab['Swaroop']

                    # Adding a key/value pair
                    ab['Guido'] = 'guido@python.org'

                    # Deleting a key/value pair
                    del ab['Spammer']

                    print '\nThere are %d contacts in the address-book\n' % len(ab)
                    for name, address in ab.items():
                        print 'Contact %s at %s' % (name, address)

                    if 'Guido' in ab: # OR ab.has_key('Guido')
                        print "\nGuido's address is %s" % ab['Guido']

                    ????????code/using_dict.py??

                    ???

                    $ python using_dict.py
                    Swaroop's address is swaroopch@byteofpython.info

                    There are 4 contacts in the address-book

                    Contact Swaroop at swaroopch@byteofpython.info
                    Contact Matsumoto at matz@ruby-lang.org
                    Contact Larry at larry@wall.org
                    Contact Guido at guido@python.org

                    Guido's address is guido@python.org

                    ????ι???

                    ???????????????????????????ab???????????????б????????????????????????????????????????????ü?/?????????????????????????????

                    ???????????????????????????????????????????????????????μ??/??????????????????????????Guido???????????

                    ????????????????????????del??????????/???????????????????????????????????????????????????????del???????????????????????????????????????????????????

                    ???????????????????items???????????????е??????/?????????????????б???????????鶼????????????????????????????????????????????for..in????е????name??address?????for?????д????Щ???

                    ??????????in?????????????????/?????????????????dict???has_key??????????????help(dict)????dict????????????б??

                    ???????????????????????????????????????????????????????????????????????????????????????????????б????????/??????????????????????????????????????????????????????????????????б????? ????? ????


                    ???? ????? ????
                    ??? ??? ????
                    ?????
                    @ssv

                      <pre id="vvttv"><mark id="vvttv"><progress id="vvttv"></progress></mark></pre>
                      <pre id="vvttv"></pre>

                        <p id="vvttv"></p>

                            <p id="vvttv"></p>

                                  <p id="vvttv"></p>

                                  <pre id="vvttv"><cite id="vvttv"><progress id="vvttv"></progress></cite></pre>

                                    <output id="vvttv"><dfn id="vvttv"><th id="vvttv"></th></dfn></output>

                                      <p id="vvttv"></p>

                                      这里只有精品视频