input: Write a function to print a pattern of asterisks in an ascending and then descending sequence based on the input value. If the input value is not given, assume it to be 5. The function should print the pattern as shown below.
  
  
  def print_pattern(n=5):
      for i in range(n):
          for j in range(i+1):
              print("*", end="")
          print("")
  
      for i in range(n, 0, -1):
          for j in range(i):
              print("*", end="")
          print("")
  
  
  # Test cases
  print_pattern(5)
  print_pattern(3)
  print_pattern()
  
  
  The function should produce the following output:
  
  
  *
  **
  ***
  ****
  *****
  *****
  ****
  ***
  **
  *
  
  *
  **
  ***
  ***
  **
  *
  
  *
  **
  ***
  ****
  *****
  *****
  ****
  ***
  **
  *
  
output: def print_pattern(n=5):
      for i in range(n):
          for j in range(i+1):
              print("*", end="")
          print("")
  
      for i in range(n, 0, -1):
          for j in range(i):
              print("*", end="")
          print("")