Operators
Python - A Quick Start for existing Programers
2 min read
Published Sep 16 2025, updated Sep 30 2025
Guide Sections
Guide Comments
Arithmetic operators
Operator | Description | Example |
| Addition |
|
| Subtraction |
|
| Multiplication |
|
| Division (float result) |
|
| Floor division (integer result) |
|
| Modulus (remainder) |
|
| Exponentiation |
|
Comparison operators
Operator | Description | Example |
| Equal to |
|
| Not equal to |
|
| Greater than |
|
| Less than |
|
| Greater than or equal to |
|
| Less than or equal to |
|
Logical operators
Operator | Description | Example |
| True if both operands are True |
|
| True if at least one operand is True |
|
| Negates the boolean value |
|
Assignment operators
Note: there is no short hand to increment or decrement a variables value that other languages have such as i++
or i--
.
Operator | Description | Example |
| Assign |
|
| Add and assign |
|
| Subtract and assign |
|
| Multiply and assign |
|
| Divide and assign |
|
| Floor divide and assign |
|
| Modulus and assign |
|
| Exponentiate and assign |
|
Identity operators
Operator | Description | Example |
| True if both refer to the same object |
|
| True if they refer to different objects |
|
Membership operators
Operator | Description | Example |
| True if value exists in a sequence |
|
| True if value does not exist in a sequence |
|
Bitwise operators
Operator | Description | Example |
& | AND |
|
| | OR |
|
^ | XOR |
|
~ | NOT |
|
<< | Left shift |
|
>> | Right shift |
|