Tuple immutable → không thể remove element. Workaround: convert tuple → list → remove → convert back.
Ví dụ
>>> T1 = (1, 2, 3, 4) >>> L1 = list(T1) >>> L1.pop(0) 1 >>> L1 [2, 3, 4] >>> T1 = tuple(L1) >>> T1 (2, 3, 4)
Tuple immutable → không thể remove element. Workaround: convert tuple → list → remove → convert back.
>>> T1 = (1, 2, 3, 4) >>> L1 = list(T1) >>> L1.pop(0) 1 >>> L1 [2, 3, 4] >>> T1 = tuple(L1) >>> T1 (2, 3, 4)