Game of life python solution