Arithmetic Operators in python
Arithmetic operators are used to perform mathematical calculations.
| Operator | Description | Example |
|---|---|---|
| + | Addition | a + b |
| - | Subtraction | a - b |
| * | Multiplication | a * b |
| / | Division | a / b |
| % | Modulus | a % b |
| ** | Exponent | a ** b |
| // | Floor Division | a // b |
Example
a = 10
b = 3
print(a + b)
print(a - b)
print(a * b)
print(a / b)
print(a % b)
print(a ** b)
print(a // b)
Output
13
7
30
3.3333333333333335
1
1000
3