Numbers & Operators in Python
Chapter 3: Numbers & Operators
4 short lessons, with 3D animations, quizzes and coding tasks.
The lessons
Arithmetic: + - * /
Python works out maths with the four operators + - * /, and / always gives a float.
Floor division, remainder and power
// counts how many full groups fit, % gives what's left over, and ** multiplies a number by itself again and again.
Which comes first? Operator order
Python works out ( ) first, then **, then * / // %, then + -, and operators on the same level go left to right.
Shortcuts and number tools
x += 3 is a short way to write x = x + 3, and Python has ready-made number tools like round, abs, max, min and the math module.