Question: what is the difference between the or logical operator and the xor logical operator?
Answer: xor is only true when either $x or $y is true, but not both (as the case for or ). xor means "exclusive or". That is to say, it's or, but with the single change that if both parameters to the operation are true, the answer is false.