input: from typing import List
  
  def generate_pattern(rows: int, cols: int) -> List[str]:
      """ Generate a pattern of '#' and ' ' characters based on the rule where each character
      in the grid is determined by whether the sum of its row and column index is even or odd.
      If the sum is even, print '#'; if the sum is odd, print ' ' (space).
      
      >>> generate_pattern(7, 7)
      ['#######', '       ', '#######', '       ', '#######', '       ', '#######']
      """
      pattern = []
      for i in range(rows):
          row = ''
          for j in range(cols):
              if (i + j) % 2 == 0:
                  row += '#'
              else:
                  row += ' '
          pattern.append(row)
      return pattern
output:     pattern = []
      for i in range(rows):
          row = ''
          for j in range(cols):
              if (i + j) % 2 == 0:
                  row += '#'
              else:
                  row += ' '
          pattern.append(row)
      return pattern