old_contents: from time import sleep
  
  
  class DisplayClass(object):
    _DISPLAY_TIMEOUT = 1  # seconds
  
    def show(self, grid):
      output = ''
      for i, row in enumerate(grid):
        for j, _ in enumerate(row):
          if grid[i][j]:
            output += ' O'
          else:
            output += ' .'
        output += '\n'
      print(output)
      sleep(self._DISPLAY_TIMEOUT)
  
new_contents: import numpy
  from time import sleep
  
  
  class DisplayClass(object):
    _DISPLAY_TIMEOUT = 1  # seconds
  
    def show(self, grid):
      output = ''
      for index, value in numpy.ndenumerate(grid):
        if value:
          output += ' O'
        else:
          output += ' .'
        if index[1] == grid.shape[1] - 1:
          output += '\n'
      print(output)
      sleep(self._DISPLAY_TIMEOUT)
  
subject: simplify display function