GCSE · Computer Science · Edexcel · Spec 1CP2
Arithmetic operators
Share 14 counters between 3 people. How many each, how many left over, and what is the exact share? A program has a different operator for each question.
Python · Arithmetic operators
One division, three answers
14 counters, 3 people. Step through the program and watch the table fill.
Before you step: counters / people, counters // people and counters % people all use the same two numbers. Will they give the same answer?
1 counters = 142 people = 33 exact = counters / people4 each = counters // people5 left = counters % people
| counters | people | exact | each | left |
|---|---|---|---|---|
| 14 |
Output
Step 1: counters is given the value 14. Nothing else has a value yet.
Step through the trace — every value is the lesson’s, not run by the page.
Python · Using %
Odd or even? Let the remainder decide.
Choose what n % 2 gives, then pick a number that gives that remainder. Every number can only go down one branch.
What n % 2 gives → A number to test
4 possible routes.
Programs often use % to test whether a number is odd or even by dividing it by 2.
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
One division, three different answers: the operator decides which one you get.
What you need to know
- An operator is a symbol or word that tells the computer to perform a specific calculation or action.
- An arithmetic expression is any expression that results in a numeric value.
- Python's arithmetic operators are +, -, *, / and ** (to the power of): score ** 2 is score to the power of two.
Have a goSay score is 6. What does score ** 2 give you?
36
** raises a value to a power, so score ** 2 is 6 to the power of two. It is not 6 * 2, which would only double it.
- Real division (/) divides the entire value, so there is no remainder.
- Integer division (//), also called floor division, discards any remainder and leaves a whole number.
Have a goPredict before you reveal: what does 20 // 6 give?
3
6 fits into 20 three whole times, and // discards the remainder instead of keeping it as a fraction.
- Modulo division (MOD, written % in Python) returns only the remainder.
Have a goYour friend is sure that 17 % 5 gives 3.4. Confident, but is it right? What does it actually give?
2
3.4 is what real division (/) would give. % returns only the remainder: 5 fits into 17 three times, leaving 2.
- Use // and % together to share things out: // gives the whole shares, % gives what is left.
- A remainder of 1 when you divide by 2 means the number is odd.
- Order of operations: brackets, indices, multiplication and division, then addition and subtraction. Equal priority goes left to right.
- A variable must be assigned a value before an expression uses it.
The big picture
Arithmetic operators tell a program which calculation to do. / keeps the entire value of a division, // keeps only the whole number, and % keeps only the remainder. Expressions are worked out in a fixed order, and a variable needs a value before an expression can use it.
Key points
Worked example
Problem
x is assigned the value 3. Work out (x + 1) * x ** 2 - 6 / 4.
⚠ Watch out
Treating /, // and % as interchangeable ways of dividing, or reading % as a percentage sign. Each operator keeps something different from the same division.
Memory hook
Slash keeps the lot, double slash bins the leftovers, percent keeps only the leftovers.
Check yourself
Without scrolling back: 31 biscuits are shared between 7 people. Which operator tells you how many each person gets, and which tells you how many are left over?
Flashcards
(12)What is an operator?
What is an arithmetic expression?
Which Python symbols mean add, subtract and multiply?
What does ** do in Python?
What does real division (/) give?
What does integer division (//) do?
What does modulo (MOD, %) return?
Which two operators partner up to share things out?
How can % show that a number is odd?
What is the order of operations?
Two operations have equal priority. Which one goes first?
What must happen to a variable before an expression uses it?
Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.
Learning with Lightbulb is opening soon
You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.
Keep me postedMore Edexcel GCSE Computer Science topics
How this lesson was checked. This Edexcel GCSE Computer Science (specification 1CP2)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 10 November 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.