I'm trying to initialize a bi-dimentional (3x3) list without typing all elements, since they are all the same.
However, it seems that only the first line of this matrix is really created as a new object, and the subsequent lines are just references to the first line.
How could I create all lines are independent objects?
Here's an example to illustrate this:
# Create a bi-dimentional list
a=[[''] * 3] * 3
print a
>>>[['', '', ''], ['', '', ''], ['', '', '']]
# change a single element, on first line
# notice that it will change also the elements at other lines
a[0][1] = 'x'
print a
[['', 'x', ''], ['', 'x', ''], ['', 'x', '']]