1. Just a Little BIT - What is XOR?



I get the whole concept of this. And I understand the shift, the and, the or, and the not, what I don't understand is what is XOR? I have never heard of this, what is it used for?

print 5 >> 4  # Right Shift
print 5 << 1  # Left Shift
print 8 & 5   # Bitwise AND
print 9 | 4   # Bitwise OR
print 12 ^ 42 # Bitwise XOR
print ~88     # Bitwise NOT


the XOR operator is explained later in this lesson, you can wait or jump ahead if you want, whatever you see fit


Ohhh ok, it's similar to anding. I was just curious considering I'm already quite proficient in binary and hex (hexadecimal), and never once have I heard someone refer to that specific operation as XOR.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.