random randint()time sleep()and copy deepcopy(functions create list of list for the cellsnextcells [for in range(width)column [create new column for in range(height)if random randint( = column append('#'add living cell elsecolumn append('add dead cell nextcells append(columnnextcells is list of column lists the very first step of our cellular automata will be completely random we need to create list of lists data structure to store the '#and strings that represent living or dead celland their place in the list of lists reflects their position on the screen the inner lists each represent column of cells the random randint( call gives an even / chance between the cell starting off alive or dead we put this list of lists in variable called nextcellsbecause the first step in our main program loop will be to copy nextcells into currentcells for our list of lists data structurethe -coordinates start at on the left and increase going rightwhile the -coordinates start at at the top and increase going down so nextcells[ ][ will represent the cell at the top left of the screenwhile nextcells[ ][ represents the cell to the right of that cell and nextcells[ ][ represents the cell beneath it while truemain program loop print('\ \ \ \ \ 'separate each step with newlines currentcells copy deepcopy(nextcellseach iteration of our main program loop will be single step of our cellular automata on each stepwe'll copy nextcells to currentcellsprint currentcells on the screenand then use the cells in currentcells to calculate the cells in nextcells print currentcells on the screenfor in range(height)for in range(width)print(currentcells[ ][ ]end=''print the or space print(print newline at the end of the row these nested for loops ensure that we print full row of cells to the screenfollowed by newline character at the end of the row we repeat this for each row in nextcells calculate the next step' cells based on current step' cellsfor in range(width)for in range(height)get neighboring coordinates