input: Write a function to generate the first n elements of the Sierpinski triangle. The function should take an integer n as input and print the elements of the triangle in a formatted manner.
  assert sierpinski_triangle(6) == None
  assert sierpinski_triangle(3) == None
  assert sierpinski_triangle(0) == None
  assert sierpinski_triangle(1) == None
  assert sierpinski_triangle(8) == None
output: def sierpinski_triangle(n):
      if n <= 0:
          return
      triangle = ["*"]
      for i in range(1, n):
          new_row = ["*"]
          for j in range(1, len(triangle[i-1])):
              if triangle[i-1][j-1] == triangle[i-1][j]:
                  new_row.append(" ")
              else:
                  new_row.append("*")
          new_row.append("*")
          triangle.append("".join(new_row))
      for row in triangle:
          print(row.center(2*n - 1))