input: Write a python function to generate a checkerboard pattern for a given size.
  assert generate_checkerboard(3) == "###\n # \n###"
  assert generate_checkerboard(5) == "#####\n # # \n#####\n # # \n#####"
  assert generate_checkerboard(2) == "##\n #"
output: def generate_checkerboard(size):
      board = []
      for i in range(size):
          if i % 2 == 0:
              board.append('#' * size)
          else:
              row = ''.join(['#' if j % 2 == 0 else ' ' for j in range(size)])
              board.append(row)
      return '\n'.join(board)