l=list(range(5))
type(l)
l
t=tuple(range(5))
type(t)
t
l[1]=9
t[1]=9 error
l.append(2)
t.append(2) error
tuple 不支持原位改變
通過上邊的語句來區分list與tuple的區別
python 區分大小寫
l=list(range(5))
type(l)
l
t=tuple(range(5))
type(t)
t
l[1]=9
t[1]=9 error
l.append(2)
t.append(2) error
tuple 不支持原位改變
通過上邊的語句來區分list與tuple的區別
python 區分大小寫