Tuple (元組)

a = (1,2,3)
# (1, 2, 3)
a = tuple((1,2,3))
# (1, 2, 3)

查詢可迭代物件

print(a)
# (1, 2, 3)
print(a[2])
# 3

List (串列)

a = [1,2,3]
# [1, 2, 3]
a = list([1,2,3])
# [1, 2, 3]

加入元素

a.append(4)
# [1, 2, 3, 4]

刪除元素

a.remove(4)
# [1, 2, 3]

刪除索引

a.pop(0)
# 1