input: Write a function to generate the first n elements of the Sierpinski triangle in Python. The function should print the triangle with 1s and 0s representing the pattern. If n is 0, the function should print nothing.
  assert sierpinski_triangle(6)
  # Output:
  #               1 
  #            1  0  1 
  #         1  0  0  0  1 
  #      1  0  0  1  0  0  1 
  #   1  0  0  1  1  0  0  1  1 
  # 1  0  0  1  1  1  1  0  0  1  1
output: def sierpinski_triangle(n):
      if n == 0:
          return
      triangle = [[1]]
      for i in range(1, n):
          row = [1]
          for j in range(1, i):
              row.append(triangle[i-1][j-1] ^ triangle[i-1][j])
          row.append(1)
          triangle.append(row)
      max_width = len(' '.join(map(str, triangle[-1])))
      for row in triangle:
          print(' '.join(map(str, row)).center(max_width))