
資料內(nèi)容:
列表 
列表是一種有序可變的集合: 
python 
numbers = [1, 2, 3, 4, 5] 
print(numbers[0]) 
numbers.append(6) 
print(numbers) 
元組 
元組是一種有序不可變的集合: 
python 
coordinates = (10.0, 20.0) 
print(coordinates[0]) 
集合 
集合是一種無序不重復(fù)的集合: 
python 
unique_numbers = {1, 2, 3, 4, 5} 
unique_numbers.add(6) 
print(unique_numbers) 
字典 
字典是一種鍵值對(duì)集合: 
python 
student = {"name": "John", "age": 20} 
print(student["name"]) 
student["age"] = 21 
print(student)