I was trying to declare multidimensional array in python (array[3][3]) and I did it wrong way like this :
>>> a = [[None] * 3] * 3
>>> a
[[None, None, None], [None, None, None], [None, None, None]]
>>> a[0][0] = 1
>>> a
[[1, None, None], [1, None, None], [1, None, None]]
I understand that the first array is not duplicated but referenced three times but I don't understand why.
Can someone explains to me how python understand this declaration ?