input: Write a function to generate the first n elements of the Sierpinski triangle.
  def sierpinski_triangle(n): 
      for i in range(2**n): 
          print(' ', end=" ") 
      
      for i in range(1, n+1): 
          for j in range(2**(i-1), 2**i): 
              print('1', end=" ") 
          print() 
          
          if i > 1: 
              for j in range(2**(i-1)+1, 2**i-1):  
                  print('0', end=" ") 
              print() 
         
  assert sierpinski_triangle(6) is not None
output: def sierpinski_triangle(n):
      result = []
      for i in range(n):
          row = ['0'] * (2 ** n)
          for j in range(2 ** i):
              row[2 ** (n - i - 1) + j * 2 ** (n - i)] = '1'
          result.append(''.join(row))
      return result