Division, remainder and powers
Learn in depth →Numeric operators calculate values; floor division rounds the quotient down.
a / b; a // b; a % b; a ** bExample
print(7 / 2, 7 // 2, -7 // 2, 7 % 2, 2 ** 3)Result
3.5 3 -4 1 8
Watch for: Division by zero raises ZeroDivisionError. Binary floating point cannot represent every decimal exactly.
Practise this topic →