The Python bitwise-inversion (or complement) operator, "~", behaves pretty much as expected when it is applied to integers—it toggles every bit, from one to zero and vice versa. It might be expected ...
You might be thinking that this is a little late to be introducing ideas about logic. Computers are created using logic gates so why wait so long to discuss them. The truth of the matter is that ...