input: Write a function to print a pattern of asterisks (*) to form a triangle that first expands and then contracts, based on the given integer input. If the input is 0 or a negative integer, the function should print nothing.
  assert triangle_pattern(5)==None
  assert triangle_pattern(0)==None
  assert triangle_pattern(-1)==None
output: def triangle_pattern(n):
      if n <= 0:
          return
      for i in range(1, n + 1):
          print('*' * i)
      for i in range(n - 1, 0, -1):
          print('*' * i)