input: Write a function to generate a checkerboard pattern of size 7x7 using '#' and ' ' characters. Return the checkerboard as a string with each row separated by a newline character. If the input size is less than 1, return an empty string.
  def generate_checkerboard(size):
      if size < 1:
          return ""
      result = ""
      for i in range(size):
          for j in range(size):
              if (i + j) % 2 == 0:
                  result += '#'
              else:
                  result += ' '
          result += '\n'
      return result.strip()
  
  assert generate_checkerboard(7)=="# # #\n# # #\n# # #\n# # #\n# # #\n# # #\n# # #"
  assert generate_checkerboard(4)=="\n#\n#\n"
  assert generate_checkerboard(0)==""
  assert generate_checkerboard(-1)==""
output: def generate_checkerboard(size):
      if size < 1:
          return ""
      result = ""
      for i in range(size):
          for j in range(size):
              if (i + j) % 2 == 0:
                  result += '#'
              else:
                  result += ' '
          result += '\n'
      return result.strip()