code:
L = [False] * 2
R = [L] * 2
print(R)
[[False, False], [False, False]]
R[0][0] = True
print(R)
[[True, False], [True, False]]
I am trying to change one element but all elements in first column change. Is this the expected behavior? Thanks
code:
L = [False] * 2
R = [L] * 2
print(R)
[[False, False], [False, False]]
R[0][0] = True
print(R)
[[True, False], [True, False]]
I am trying to change one element but all elements in first column change. Is this the expected behavior? Thanks