I'm stunned by this behavior, and can't seem to pinpoint what's causing the issue. I'd consider myself fluent in Python, but I'm completely at loss here.
>>> board = [[0]*3]*3
>>> board
[[0, 0, 0], [0, 0, 0], [0, 0, 0]]
>>> board[1]
[0, 0, 0]
>>> board[1][1]
0
# Expected behavior: [[0, 0, 0], [0, 1, 0], [0, 0, 0]]
>>> board[1][1] = 1
# Actual behavior:
>>> board
[[0, 1, 0], [0, 1, 0], [0, 1, 0]]
Running Python 3.9.5 on arm64 macOS 11.4
% python3 --version
Python 3.9.5