Values & References17 / 18
Up next

Shallow copy shares nested objects

import copy

grid = [[1, 2], [3, 4]]
shallow = copy.copy(grid)
# the inner lists are the SAME objects
shallow[0].append(99)
print(grid[0])
What you're solving

inner lists are still shared after copy.copy