Bitwise Operators
This lesson showcases all the different bitwise operators available in Python.
We'll cover the following
In programming, all data is actually made up of 0
s and 1
s known as bits. Bitwise operators allow us to perform bit-related operations on values.
Operator | Purpose | Notation |
---|---|---|
& |
Bitwise AND | In-fix |
| |
Bitwise OR | In-fix |
^ |
Bitwise XOR | In-fix |
~ |
Bitwise NOT | Prefix |
<< |
Shift Bits Left | In-fix |
>> |
Shift Bits Right | In-fix |
Examples #
Get hands-on with 1200+ tech skills courses.