input: Write a function to generate the first n elements of the Sierpinski triangle. The function should print the Sierpinski triangle pattern for the given number of rows. The input should be the number of rows, n, and the output should be the pattern printed in the console. If the input is 0, the function should not print anything.
  
  
  def sierpinski_triangle(n): 
      if n == 0: 
          return 
      
      # Initialize the first row with spaces 
      print(' '.join([' ' for _ in range(2**n)])) 
      
      # Loop through each row 
      for i in range(1, n+1): 
          # Print the border '1's 
          print(' '.join(['1' for _ in range(2**(i-1), 2**i)])) 
          
          # Print the inner '0's if not the first row 
          if i > 1: 
              print(' '.join(['0' for _ in range(2**(i-1)+1, 2**i-1)])) 
  
  assert sierpinski_triangle(0) == None
  assert sierpinski_triangle(2) == None
  assert sierpinski_triangle(4) == None
  
output: def sierpinski_triangle(n): 
      if n == 0: 
          return 
      
      for i in range(n): 
          row = ['0'] * (2**(i+1)) 
          row[2**i - 1] = '1' 
          for j in range(2**i - 1): 
              if row[j] == '1': 
                  row[j + 2**i] = '1' 
          print(' '.join(row))