The following is equivalent to the missing exclusive-or operator a xor b
(not a and b) or (not b and a)
Alternatively, if a
and b
are boolean values, a != b
is the same as the above. If they are not, they must be converted first:
bool(a) != bool(b)