Trịnh Tấn Đạt
Đại Học Sài Gòn
trinhtandat@sgu.edu.vn
http://sites.google.com/site/ttdat88
Nội Dung
Cách tạo List
Các hàm và toán tử trên List
Cách tạo 2D List
Các hàm toán tử trên 2D List
Tạo List
List Rỗng: [] hoặc dùng list()
print("Two standard ways to create an empty list:")
a = [ ]
b = list()
print(type(a), len(a), a)
print(type(b), len(b), b) print(a == b)
Tạo List
List một phần tử
a = [ "hello" ]
b = [ 42 ]
print(type(a), len(a), a)
print(type(b), len(b), b)
print(a == b)