input: Write a python function to print a pyramid pattern of height `h` using asterisks.
  assert pyramid(3) == "  * \n * * \n* * * \n"
  assert pyramid(5) == "    * \n   * * \n  * * * \n * * * * \n* * * * * \n"
  assert pyramid(1) == "* \n"
output: def pyramid(h):
      result = []
      for i in range(h):
          result.append(' ' * (h - i - 1) + '* ' * (i + 1))
      return '\n'.join(result) + '\n'