input: Write a function to generate the first n elements of the Sierpinski triangle. The function should print the bit pattern for each row of the triangle. If n is 1, it should print a single '1'. For higher values of n, the function should alternate between '1' and '0' to create the Sierpinski pattern.
  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)
  assert sierpinski_triangle(1)==None
  assert sierpinski_triangle(2)==None
  assert sierpinski_triangle(3)==None
  assert sierpinski_triangle(4)==None
  assert sierpinski_triangle(5)==None
output: def sierpinski_triangle(n): 
      for i in range(n): 
          for j in range(2**i): 
              print('1' if bin(j)[2:].count('1') % 2 == 0 else '0', end=" ") 
          print()