A shallow copy of a value is a new value whose parts refer to the same objects as the parts of the original. A deep copy copies the parts too, and their parts, all the way down, so that it shares nothing mutable with the original. In Python, list(a) and a[:] make shallow copies, and copy.deepcopy(a) makes a deep copy.
grid and its shallow copy are two outer lists sharing the same two rows, so the 9 written through shallow is seen through grid; the deep copy has rows of its own.