I try to change the first value of a field in python to true. What am I doing wrong? The whole column changes and I don't understand why.
My Code:
def selectElement(self, col, row):
print(col, row)
print(self)
self.field[col][row] = True
print(self)
def __str__(self):
out = '\n'
for col in self.field:
for value in col:
out += str(value) + ' '
out += '\n'
return out
The Output:
0 0
False False False
False False False
False False False
True False False
True False False
True False False
The list is initialised with:
self.list = [[False] * size] * size