input: Write a python function to print a pyramid pattern.
  assert print_pyramid(3) == "  *  \n *** \n*****"
  assert print_pyramid(5) == "    *    \n   ***   \n  *****  \n ******* \n*********"
  assert print_pyramid(1) == "*"
output: def print_pyramid(n):
      result = []
      for i in range(n):
          spaces = ' ' * (n - i - 1)
          stars = '*' * (2 * i + 1)
          result.append(spaces + stars + spaces)
      return '\n'.join(result)