code: def xor_fault(a, b, out, fault):
      
      if (a != b) == out:
          return fault == 0
      else:
          return fault == 1
docs: Returns True if XOR(a, b) == out and fault == 0 or XOR(a, b) != out and fault == 1.