input: 
  def print_pyramid_and_reverse(n: int) -> str:
      """ Print a pyramid pattern of asterisks and then a reverse pyramid below it based on the input number n.
      >>> print_pyramid_and_reverse(5)
      *
      **
      ***
      ****
      *****
      *****
      ****
      ***
      **
      *
      """
  
output:     result = ""
      for i in range(1, n + 1):
          result += "*" * i + "\n"
      for i in range(n, 0, -1):
          result += "*" * i + "\n"
      return result