Bitwise Operators
suggest changeIntroduction
Bitwise operations change integers at the bit level. These operations are basic and, for values that fit in a machine word, are supported directly by the processor. These few operations are necessary in working with device drivers, low-level graphics, cryptography, and network communications. This section provides useful knowledge and examples of Python’s bitwise operators.
Syntax
x << y# Bitwise Left Shiftx >> y# Bitwise Right Shiftx & y# Bitwise ANDx | y# Bitwise OR~ x# Bitwise NOTx ^ y# Bitwise XOR
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents