GCSE · Computer Science · AQA · Spec 8525
Less than or equal to (relational operator)
'Maximum 8 people,' says the lift sign. Eight step in. Allowed? Of course: 8 is the limit, not over it. Programs say 'up to and including' with one symbol: ≤.
Computer Science · Programming
Follow the loop right up to its limit
Press Next to move one step at a time. Keep your eye on the diamond when count reaches 3.
Predict first: when count reaches 3, does the path go round the loop again?
Output
Step 1: Start. This program counts upwards, and the diamond sets the limit: 3.
Next moves one step, Back moves one step back, and Play runs the whole thing.
Predict, then check
Same idea, written for two different readers.
Here is one loop condition written twice. Pseudocode: WHILE count ≤ 3. Python: while count <= 3 — do these two lines test the same thing?
AQA pseudo-code writes this operator as the single symbol ≤.
Computer Science · Algorithms
Trace table — dry run the code
A new loop, traced the way you'd do it on paper. The n ≤ 8 column records every check. Predict the output before you reach the last row.
Ready when you are — step through one line at a time.
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
The comparison that lets the equal value through.
What you need to know
- ≤ means 'less than or equal to'. It compares two values, and the answer is always True or False.
- x ≤ 5 is True when x is smaller than 5 AND when x is exactly 5. It is only False when x is bigger than 5.
- In a loop controlled by WHILE count ≤ 3, the loop body still runs when count equals 3, because the limit is included.
- Languages write the same test in different ways. Pseudocode can use ≤; many programming languages, such as Python, type it as <=.
The big picture
≤ compares two values and gives True when the left value is smaller than the right one OR equal to it. In an IF or WHILE condition that means the limit itself is included, so a loop controlled by count ≤ 3 still runs when count is 3. Different languages write the same test differently; many type it as <=.
Key points
Worked example
Problem
A cinema lets children aged 12 or under in for half price. Write an IF statement that outputs "Half price" for these children, using a variable called age.
⚠ Watch out
Treating ≤ as if it were <. When tracing WHILE count ≤ 3, it's easy to stop as soon as count reaches 3, but 3 ≤ 3 is True, so the loop body runs once more and 3 is output.
Memory hook
≤ is just < with a line underneath, and that line is the 'or equal' part. No line means no equals, and the limit gets turned away.
Check yourself
No peeking: n ← 2, then WHILE n ≤ 6 the loop outputs n and adds 2. What gets output? (Answer: 2, 4, 6. 6 ≤ 6 is True, so 6 is output.)
Flashcards
(8)What does the operator ≤ mean?
What kind of answer does a comparison like x ≤ 5 give?
7 ≤ 7 and 7 < 7: which one is True?
When is x ≤ 10 False?
How do many languages, such as Python, type ≤?
Which words in a task point to ≤?
In a loop with WHILE count ≤ limit, does the body run when count equals the limit?
Is x ≤ 5 the same test as 5 ≤ x?
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 AQA GCSE Computer Science topics
How this lesson was checked. This AQA GCSE Computer Science (specification 8525)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 30 September 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.