is examined the most common is to assume any neighboring cell lying outside the grid contains dead organism listing the life py module implements the lifegrid adt for use with the game of life from array import array class lifegrid defines constants to represent the cell states dead_cell live_cell creates the game grid and initializes the cells to dead def __init__selfnumrowsnumcols )allocate the - array for the grid self _grid array dnumrowsnumcols clear the grid and set all cells to dead self configurelist(returns the number of rows in the grid def numrowsself )return self _grid numrows(returns the number of columns in the grid def numcolsself )return self _grid numcols(configures the grid to contain the given live cells def configureselfcoordlist )clear the game grid for in rangenumrows )for in rangenumcols )self clearcellij set the indicated cells to be alive for coord in coordlist self setcellcoord[ ]coord[ does the indicated cell contain live organismdef islivecellselfrowcol )return self _grid[rowcol=gamegrid live_cell clears the indicated cell by setting it to dead def clearcellselfrowcol )self _grid[rowcolgamegrid dead_cell sets the indicated cell to be alive def setcellselfrowcol )self _grid[rowcolgamegrid live_cell returns the number of live neighbors for the given cell def numliveneighborsselfrowcol )