Output: [[0] * 3] * 3, then assign one cell
EasyP2Output
What does this code print?
1grid = [[0] * 3] * 32grid[0][0] = 13print(grid)45good = [[0] * 3 for _ in range(3)]6good[0][0] = 17print(good)
Saved automatically
One line per print, as Python prints it. An uncaught exception as its last traceback line, for example ZeroDivisionError: division by zero.
Hints
Saved automatically