input: Write a python function to print a chessboard pattern of size n.
  assert print_chessboard(2) == "X O \nO X \n"
  assert print_chessboard(3) == "X O X \nO X O \nX O X \n"
  assert print_chessboard(4) == "X O X O \nO X O X \nX O X O \nO X O X \n"
output: def print_chessboard(n):
      result = []
      for i in range(n):
          row = []
          for j in range(n):
              if (i + j) % 2 == 0:
                  row.append('X')
              else:
                  row.append('O')
          result.append(' '.join(row) + ' \n')
      return ''.join(result)