input: Write a function to generate the first n elements of the Sierpinski triangle in binary format. If n is 0, the function should return an empty list.
  assert sierpinski_triangle(0)==[]
  assert sierpinski_triangle(1)==["1"]
  assert sierpinski_triangle(2)==["1", "1 1"]
  assert sierpinski_triangle(3)==["1", "1 1", "1 0 1"]
  assert sierpinski_triangle(4)==["1", "1 1", "1 0 1", "1 1 1 1"]
  assert sierpinski_triangle(5)==["1", "1 1", "1 0 1", "1 1 1 1", "1 0 0 0 1"]
output: def sierpinski_triangle(n):
      if n == 0:
          return []
      result = ["1"]
      for i in range(1, n):
          prev = result[-1]
          new_row = []
          for j in range(len(prev) + 1):
              if j == 0 or j == len(prev):
                  new_row.append("1")
              else:
                  new_row.append(str(int(prev[j-1]) ^ int(prev[j])))
          result.append(" ".join(new_row))
      return result