Skip to content

Maths in Python

Read · 1 of 5

Two kinds of division

/ always gives a float: 7 / 2 is 3.5. // gives the whole-number part: 7 // 2 is 3. % is the remainder: 7 % 2 is 1. ** is power: 2 ** 10 is 1024.

Python's ints never overflow: they can be as big as you like.