Page 26 - Python Cơ Bản
P. 26

numbers = [1, 2, 3, 4, 5, 6, 7]

           del numbers[2:4]

           print numbers

           (HiӅn thӍ [1, 2, 5, 6, 7])





                 2РM   QϲRK





          &ϰR Gɹ XLВ Wм HдRK XSɨR Xм  +  чВ RРM KMɨ XVК GжE   QϲRK Zɧ


          XϰS VE QШX QϲRK PЪR Gɹ WР PšвRK TL϶R Xм Pɧ XФRK WР PšвRK

          TL϶R Xм GжE   QϲRK GSR  :ɴ Hд






           a = [1, 2]

           b = [1, 3]



           print a + b

           (HiӅn thӍ [1, 2, 1, 3])





                 8LɱQ TL϶R Xм ZɧS QϲRK





          2ЎY FϰR QYРR XLɱQ TL϶R Xм ZɧS QШX QϲRK чɪ XТR XϰM  Lɪ]


          HɽRK TLš˜RK XLиG  list.append(newvalue)  чВ XLɱQ TL϶R

          Xм Gɹ KMɨ XVК  newvalue  ZɧS GYРM QϲRK  list   :ɴ Hд
   21   22   23   24   25   26   27   28   29   30   31