List là sequence data type. Comma-separated elements (không cần cùng type) trong ngoặc vuông [ ]. List là ordered collection. Truy cập element bằng zero-based index.
Ví dụ
list1 = ['physics', 'chemistry', 1997, 2000] list2 = [1, 2, 3, 4, 5] list3 = ["a", "b", "c", "d"]
Empty list
list1 = []
Operators cơ bản
len(list): độ dàilist[index]: truy cập elementlist.append(x): thêm cuốilist.insert(i, x): chèn tại vị trílist.remove(x): xóa first occurrencelist.pop(i): xóa và trả về element tại index