You are given two booleans p and q.
Your task is to compute the exclusive or (XOR) of p and q.
Note that:
true when exactly one of the two inputs is true, and false otherwise.Return the result of p XOR q.
p = True
q = False
True
Exactly one input is true, so XOR returns true.
p = True
q = True
False
Both inputs are true, so XOR returns false.
p = False
q = False
False
Neither input is true, so XOR returns false.
p = True
q = False
True