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 = 14
2 people = 3
3 exact = counters / people
4 each = counters // people
5 left = counters % people
counterspeopleexacteachleft
14

Output

 

Step 1: counters is given the value 14. Nothing else has a value yet.

1 / 5

Step through the trace — every value is the lesson’s, not run by the page.

Step 1 of 5: counters is given the value 14. Nothing else has a value yet..

Watch out: /, // and % are not three spellings of 'divide'. Each one hands back something different.

Python · Which idea is yours?

What does 14 % 3 give?

You see the line left = 14 % 3 in a program.

Which of these is closest to what you think it gives?
How sure are you?

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.

On Test a whole number n: work out n % 2. 2 branches to choose from.

Programs often use % to test whether a number is odd or even by dividing it by 2.

Python · Order of operations

Which operation goes next?

Work out 10 - 2 + 2 * 5. At each gap, choose the operation a program does next.

  1. 10 - 2 + 2 * 5Three operators, and only one of them can go first.
  2. missing step
Which line is step 2?

Python · Assign before you use

Find the line that reads too early

This short program should add 4 to the area of a square. One line uses a variable before it has been given a value. Which line is it?

A pupil's program — which line goes wrong?

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

1/ keeps the entire value, // keeps only the whole number, and % keeps only the remainder.
2// and % are partners: one counts the whole shares, the other counts what is left over.
3Brackets, indices, multiplication and division, then addition and subtraction; equal priority goes left to right.
4Give every variable a value before an expression uses it.

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?
A symbol or word that instructs the computer to perform a specific calculation or action.
What is an arithmetic expression?
An expression that results in a numeric value.
Which Python symbols mean add, subtract and multiply?
+ for addition, - for subtraction and * for multiplication.
What does ** do in Python?
Exponentiation: it raises a value to a power.
What does real division (/) give?
The entire value of the division, so there is no remainder.
What does integer division (//) do?
It discards any remainder and leaves a whole number. It is sometimes called floor division.
What does modulo (MOD, %) return?
Only the remainder of a division.
Which two operators partner up to share things out?
// for how many whole shares each, and % for how many are left over.
How can % show that a number is odd?
Divide by 2: a remainder of 1 means odd.
What is the order of operations?
Brackets, then indices, then multiplication and division, then addition and subtraction.
Two operations have equal priority. Which one goes first?
Carry them out from left to right.
What must happen to a variable before an expression uses it?
It must have been assigned a value.

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 posted

More Edexcel GCSE Computer Science topics

See the full Edexcel Computer Science curriculum →

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.