input: Write a function to generate the first n elements of the Sierpinski triangle. The function should print the elements as described in the instruction. If n is less than or equal to 0, the function should print an empty line.
  def sierpinski_triangle(n): 
      if n <= 0:
          print()
          return
      # Drawing lines for first row 
      for i in range(2**n): 
          print(' ', end=" ") 
      
      # loop for printing n rows 
      for i in range(1, n+1): 
          # bit pattern for first and 
          # last line of each row 
          for j in range(2**(i-1), 2**i): 
              print('1', end=" ") 
          print() 
          
          # inner rows have opposite bit pattern 
          if i > 1: 
              for j in range(2**(i-1)+1, 2**i-1):  
                  print('0', end=" ") 
              print() 
         
  assert sierpinski_triangle(6)==None
  assert sierpinski_triangle(3)==None
  assert sierpinski_triangle(0)==None
  assert sierpinski_triangle(-1)==None
output: def sierpinski_triangle(n): 
      if n <= 0:
          print()
          return
      triangle = ["0"]
      for i in range(1, n):
          next_row = triangle[-1] + "0" + triangle[-1]
          triangle.append(next_row)
      for row in triangle:
          print(" ".join(row))