input: from typing import List
  
  def pattern_generator(size: int) -> str:
      """ Generate a pattern of size x size where each cell is filled based on the
      sum of its row and column indices, using '#' for even sums and ' ' for odd sums.
      >>> pattern_generator(7)
      '#######\n# # # #\n#######\n# # # #\n#######\n# # # #\n#######\n'
      """
      pattern = ""
      for i in range(size):
          for j in range(size):
              if (i + j) % 2 == 0:
                  pattern += '#'
              else:
                  pattern += ' '
          pattern += '\n'
      return pattern.strip()
output:     pattern = ""
      for i in range(size):
          for j in range(size):
              if (i + j) % 2 == 0:
                  pattern += '#'
              else:
                  pattern += ' '
          pattern += '\n'
      return pattern.strip()