Can someone give a suitable example of the XOR Operator in Python ? I understand its definition but couldn’t implement it. So, please explain with a suitable example.
Thanks in advance
Can someone give a suitable example of the XOR Operator in Python ? I understand its definition but couldn’t implement it. So, please explain with a suitable example.
Thanks in advance
This is a fair enough implementation:
def xor(a:bool, b:bool)->bool:
return (not a) == (b)