Python Fundamentals / Getting started
Lesson 6 of 38
Numbers and maths
Python has ints (whole numbers) and floats (decimals). Use + - * / for maths, // for whole-number division, % for the remainder and ** for powers.
Key points
- 7 // 2 is 3
- 7 % 2 is 1
- 2 ** 3 is 8
print(7 // 2) # 3
print(7 % 2) # 1
print(2 ** 10) # 1024Quiz · +10 XP
What does 10 % 3 give?
Log in to save progress and earn XP.