In this code, you assign the first element, which is not possible in the tuple.
>>> a = ([],)
>>> a[0] = a[0] + [1,2,3]
a[0]+[1,2,3], a[0], .
.
>>> c = ([], )
>>> c[0].extend([1,2,3])
, , . , :
x , .
>>> x=[]
>>> id(x)
139987361764560
>>> id([])
139987361677112
>>> id(x+[1])
139987361829736
>>> x.append(1)
>>> x
[1]
>>> id(x)
139987361764560
, id [], x x+[1] , x 1 . , a[0] = a[0] + [1,2,3] , .
, id:
>>> id(y)
139987361830168
>>> id(y[0])
139987361677112
>>> id(y[1])
139987361723384
>>> y[1] = y[1]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'tuple' object does not support item assignment
>>> y[1].append(1)
>>> id(y[1])
139987361723384
>>> y
([], [1])
, y . , . , , , .
: , , .
user764357