リストは内容を変更可能。タプルは不可。
リストは[]で表す。タプルは()。要素が2つ以上なら()が無くてもOK。
>>> a = [0, 1, 2 ,3 ,4 ,5, 6] >>> a[0] = 1 >>> a[0] 1 >>> a = (0, 1, 2 ,3 ,4 ,5, 6) >>> a[0] = 1 Traceback (most recent call last): File "", line 1, in -toplevel- a[0] = 1 TypeError: object does not support item assignment >>> b = 0, 1, 2 >>> b (0, 1, 2) >>> c = 0, >>> c (0,) >>>