When I execute the code below
A = [[None] * 3] * 3
print(A)
A[0][0] = 1
print(A)
The two prints return
[[None, None, None], [None, None, None], [None, None, None]]
[[1, None, None], [1, None, None], [1, None, None]]
The statement A[0][0] = 1
assigns the value 1
to A[0][0]
, A[1][0]
, and A[2][0]
instead of just assigning it to A[0][0]
. Why is this the case?