arrays listing the gameoflife py program program for playing the game of life from life import lifegrid define the initial configuration of live cells init_config ( , )( , )( , )( , set the size of the grid grid_width grid_height indicate the number of generations num_gens def main()construct the game grid and configure it grid lifegridgrid_widthgrid_height grid configureinit_config play the game drawgrid for in rangenum_gens )evolvegrid drawgrid generates the next generation of organisms def evolvegrid )list for storing the live cells of the next generation livecells list(iterate over the elements of the grid for in rangegrid numrows(for in rangegrid numcols(determine the number of live neighbors for this cell neighbors grid numliveneighborsij add the ( ,jtuple to livecells if this cell contains live organism in the next generation if (neighbors = and grid islivecellij )or (neighbors = livecells append(ijreconfigure the grid using the livecells coord list grid configurelivecells prints text-based representation of the game grid def drawgrid )executes the main routine main(