Python supports a full range of arithmetic operators:

OperatorOperationExampleResult
+Addition5 + 38
-Subtraction10 - 46
*Multiplication3 * 721
/Division15 / 43.75
//Integer division15 // 43
%Modulus (remainder)15 % 43
**Exponentiation (power)2 ** 38

Division vs Integer Division

Regular division (/) always returns a float:

>>> 10 / 3
3.3333333333333335
>>> 10 / 2
5.0

Integer division (//) returns only the whole number part, discarding the remainder:

>>> 10 // 3
3
>>> 10 // 2
5

The Modulus Operator

The modulus operator (%) returns the remainder after division:

>>> 10 % 3
1
>>> 15 % 4
3
>>> 20 % 5
0

This is very useful for checking divisibility (if the remainder is 0, the number divides evenly).

The Power Operator

The ** operator raises a number to a power:

>>> 2 ** 3
8
>>> 5 ** 2
25
>>> 10 ** 0
1

Worked Example: Area of a Rectangle

length = float(input("Enter the length in cm: "))
width = float(input("Enter the width in cm: "))
print("The area is", length * width, "cm²")

Worked Example: Converting Seconds

total_seconds = int(input("Enter seconds: "))
hours = total_seconds // 3600
minutes = (total_seconds % 3600) // 60
seconds = total_seconds % 60
print(hours, "hours", minutes, "minutes", seconds, "seconds")