Update grid.py

Here is my homework :)