input: Write a function to generate a pattern similar to a chessboard with '#' and spaces, where the '#' appears in positions where the sum of the row and column indices is even. If the input is less than or equal to 0, the function should return an empty string.
  
  def generate_chessboard_pattern(n):
      if n <= 0:
          return ""
      result = ""
      for i in range(n):
          for j in range(n):
              if (i + j) % 2 == 0:
                  result += '#'
              else:
                  result += ' '
          result += '\n'
      return result
  
  assert generate_chessboard_pattern(7) == "# # # # \n # # # #\n# # # # \n # # # #\n# # # # \n # # # #\n# # # # \n"
  assert generate_chessboard_pattern(5) == "# # \n # #\n# # \n # #\n# # \n"
  assert generate_chessboard_pattern(0) == ""
  assert generate_chessboard_pattern(-3) == ""
  assert generate_chessboard_pattern(1) == "#\n"
output: def generate_chessboard_pattern(n):
      if n <= 0:
          return ""
      result = ""
      for i in range(n):
          for j in range(n):
              if (i + j) % 2 == 0:
                  result += '#'
              else:
                  result += ' '
          result += '\n'
      return result