<span id="7ztzv"></span>
<sub id="7ztzv"></sub>

<span id="7ztzv"></span><form id="7ztzv"></form>

<span id="7ztzv"></span>

        <address id="7ztzv"></address>

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

            ????

            ?忌??????????????????孝??????????????????????????????????快???????????????????????????????????????????????????????????????????????????????????????????????????快???????????????????妊?

            ???????

            ??9.5 ???????

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


            shoplist = ['apple', 'mango', 'carrot', 'banana']

            # Indexing or 'Subscription' operation
            print 'Item 0 is', shoplist[0]
            print 'Item 1 is', shoplist[1]
            print 'Item 2 is', shoplist[2]
            print 'Item 3 is', shoplist[3]
            print 'Item -1 is', shoplist[-1]
            print 'Item -2 is', shoplist[-2]

            # Slicing on a list
            print 'Item 1 to 3 is', shoplist[1:3]
            print 'Item 2 to end is', shoplist[2:]
            print 'Item 1 to -1 is', shoplist[1:-1]
            print 'Item start to end is', shoplist[:]

            # Slicing on a string
            name = 'swaroop'
            print 'characters 1 to 3 is', name[1:3]
            print 'characters 2 to end is', name[2:]
            print 'characters 1 to -1 is', name[1:-1]
            print 'characters start to end is', name[:]

            ????????code/seq.py??

            ???

            $ python seq.py
            Item 0 is apple
            Item 1 is mango
            Item 2 is carrot
            Item 3 is banana
            Item -1 is banana
            Item -2 is carrot
            Item 1 to 3 is ['mango', 'carrot']
            Item 2 to end is ['carrot', 'banana']
            Item 1 to -1 is ['mango', 'carrot']
            Item start to end is ['apple', 'mango', 'carrot', 'banana']
            characters 1 to 3 is wa
            characters 2 to end is aroop
            characters 1 to -1 is waroo
            characters start to end is swaroop

            ????牝???

            ?????????????????????????????????快?????????????????????㊣????????????‾??????快?????????????????快????Python????????????忪??竹?????????????Python??0?????????????shoplist[0]????????????shoplist[3]??shoplist?????快?????????

            ??????????????????????????????㏒?竹?????????汕?????????????shoplist[-1]??????快???????????shoplist[-2]?????快??????????????

            ????????????????????????????????????????????????????????e???��?????????????????????????????????????????????e?????????

            ??????????快?????????e?????????????????竹????????????e???????????????????????????????????????Python?????????????????????????????????Python??????????汕?????????????忱???竹?? ??? ??????? ???? 竹???????????????竹?????????????????快????????竹?????????????

            ??????shoplist[1:3]?????竹??1?????????竹??2??????????竹??3???????????????????????????????????????????????shoplist[:]???????????快??????

            ??????????????????????????????汕????????竹?芍????縺shoplist[:-1]???????????????????????????????????????

            ???Python??????????????????????????????????????????????????????????快?????????????????????????????????��?忌?????????


            ???? ????? ????
            ??? ??? ?羊?
            ?????
            @ssv
            <span id="7ztzv"></span>
            <sub id="7ztzv"></sub>

            <span id="7ztzv"></span><form id="7ztzv"></form>

            <span id="7ztzv"></span>

                  <address id="7ztzv"></address>

                      捚粔韁藝婓盄