Daily #3 · 1 October 2026
One change, two rows Medium
What does this print?
grid = [[0] * 3] * 2 grid[0][0] = 1 print(grid)
Show the answer
D: [[1, 0, 0], [1, 0, 0]]
Why: * 2 copies the reference to the inner list, so both rows are the same list. Change one and you have changed both. [[0] * 3 for _ in range(2)] builds two separate rows.