input: Write a function to generate the first n elements of the Sierpinski triangle. This function should print the Sierpinski triangle up to n rows, where each row follows the specific bit pattern 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() 
  
  sierpinski_triangle(6)
output: def sierpinski_triangle(n):
      for i in range(n):
          row = ''
          for j in range(n-i-1):
              row += ' '
          for j in range(i+1):
              if (j & (i - j)) == 0:
                  row += '1 '
              else:
                  row += '0 '
          print(row)