Course contents0/6 done

Operators

Maths, comparisons and logic — including the three operators beginners mix up.

Lesson 3 of 6 7 min

You will learn

  • Use + − * / // % **
  • Compare values with == != < >
  • Combine conditions with and, or, not

Arithmetic

OperatorMeaningExampleResult
/division (always a float)7 / 23.5
//floor division7 // 23
%remainder7 % 21
**power2 ** 532
Python · try it

Output appears here · Ctrl + Enter to run

Checkpoint

1. What is 17 % 5?

2. How do you check if a number n is even?