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 TLRK XLиG list.append(newvalue) чВ XLɱQ TL϶R
Xм Gɹ KMɨ XVК newvalue ZɧS GYРM QϲRK list :ɴ Hд