input: Write a function to generate the first n elements of the Sierpinski triangle. The function should draw lines for the first row and then loop for printing n rows with appropriate bit patterns.
  
  ### Function:
  def sierpinski_triangle(n): 
      # 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() 
  
  ### Assertions:
  assert sierpinski_triangle(6)  # Should print the first 6 elements of the Sierpinski triangle correctly
output: def sierpinski_triangle(n): 
      for i in range(n): 
          for j in range(n-i-1): 
              print(' ', end=" ") 
          for j in range(2**i): 
              if j & (j >> 1) == 0: 
                  print('1', end=" ") 
              else: 
                  print('0', end=" ") 
          print()