What Are Arithmetic Operators in Python?
Arithmetic operators are symbols that perform mathematical calculations on numeric values (operands). These operators add, subtract, multiply, divide, and perform other numeric operations in a Python program. Python supports several arithmetic operators with familiar math behavior.
| Operator | Name | Description | Example | Output |
|---|---|---|---|---|
+ | Addition | Adds two values | 10 + 5 | 15 |
- | Subtraction | Subtracts second value from first | 10 - 5 | 5 |
* | Multiplication | Multiplies two values | 10 * 5 | 50 |
/ | Division | Returns result in decimal | 10 / 3 | 3.3333... |
// | Floor Division | Returns integer part only | 10 // 3 | 3 |
% | Modulus | Returns remainder | 10 % 3 | 1 |
** | Exponent | Power operator | 2 ** 3 | 8 |
1. Addition Operator - ' + ' :
Add two values
2. Subtraction Operator - ' - ' :
Subtract two values
3. Multiplication Operator - ' * ' :
Multiply two values
4. Division Operator - ' / ' :
Division always returns a float value, even if divisible. If divided by 0, it shows error.
5. Floor Division - ' // ' :
Returns only the integer part of division i.e, Quotient part of the division
6. Modulus Operator - ' % ' :
Returns the remainder of division.
7. Exponent Operator - ' ** ' :
Used to calculate power