conway' game of life is an example of cellular automataa set of rules governing the behavior of field made up of discrete cells in practiceit creates pretty animation to look at you can draw out each step on graph paperusing the squares as cells filled-in square will be "aliveand an empty square will be "dead if living square has two or three living neighborsit continues to live on the next step if dead square has exactly three living neighborsit comes alive on the next step every other square dies or remains dead on the next step you can see an example of the progression of steps in figure - figure - four steps in conway' game of life simulation even though the rules are simplethere are many surprising behaviors that emerge patterns in conway' game of life can moveself-replicateor even mimic cpus but at the foundation of all of this complexadvanced behavior is rather simple program we can use list of lists to represent the two-dimensional field the inner list represents each column of squares and stores '#hash string for living squares and space string for dead squares type the following source code into the file editorand save the file as conway py it' fine if you don' quite understand how all of the code worksjust enter it and follow along with comments and explanations provided here as close as you canconway' game of life import randomtimecopy width height 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 while truemain program loop print('\ \ \ \ \ 'separate each step with newlines currentcells copy deepcopy(nextcells