Dùng constructor list().
Ví dụ đơn giản
x = (1, 2, 3) y = list(x) print(y) # [1, 2, 3]
Flatten multi-level tuple
z = ((1, 2, 3), (4, 5)) y = [a for b in z for a in b] print(y) # [1, 2, 3, 4, 5]
Dùng constructor list().
x = (1, 2, 3) y = list(x) print(y) # [1, 2, 3]
z = ((1, 2, 3), (4, 5)) y = [a for b in z for a in b] print(y) # [1, 2, 3, 4, 5]