GCSE · Computer Science · AQA · Spec 8525
Boolean data type
Is the password right? Is the level done? To a computer these are not questions. Each one is a value, True or False, and it decides what happens next.
Computer Science · Algorithms
Trace table — dry run the code
A game gives 6 points a round and unlocks a badge once the score is over 10. Before each step, predict what goes in the two comparison columns: True or False?
Ready when you are — step through one line at a time.
What if the flag never flips?
Same badge program. This time, imagine line 6 (unlocked ← True) has been deleted.
What happens when the program runs now?
Which data type should hold it?
Pick an item, then pick the data type that should store it.
Still to sort
Boolean (0)
Only ever True or False.
Where the line is: Exactly two possible states. If a third answer is possible, it is not a Boolean.
Integer (0)
Whole numbers.
Floating point (real) (0)
Numbers that can have a decimal part.
String (0)
Text: a sequence of characters.
Where the line is: Anything stored inside quotation marks is text, even if it spells "True".
A Boolean is one of several common data types. Sort each piece of data into the type that fits it best.
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
True or False: the one value that decides what a program does next.
What you need to know
- A Boolean is a data type that can hold only two values: True or False.
- A comparison such as x > 3 or score > 10 evaluates to a Boolean value.
- IF statements and condition-controlled loops (like WHILE) use a Boolean value to decide what runs next.
- A Boolean flag starts as False and is set to True when something happens, such as an item being found.
- Store two-state data as a Boolean. "True" in quotation marks is a string, not a Boolean.
The big picture
A Boolean is a data type with only two possible values: True and False. Any comparison, such as score > 10 or 7 > 3, is worked out to one of those two values. IF statements use that value to choose which instructions run, and condition-controlled loops such as WHILE check it before every lap to decide whether to repeat. A Boolean flag is a variable that starts False and is switched to True when something happens. Two-state data should be stored as a Boolean, not as text like "True".
Key points
Worked example
Problem
Dry-run this code and state what it outputs. battery ← 15 lowPower ← battery < 20 IF lowPower = True THEN OUTPUT "Charge me" ENDIF
⚠ Watch out
Putting a Boolean in quotation marks, for example found ← "True". That stores a string that spells a word, not the Boolean value True, so later conditions that test the flag do not behave as intended. Write found ← True, with no quotes.
Memory hook
Two values, no third, no quotes: a Boolean is True or False, and "True" in quotation marks is just a word.
Check yourself
Without looking back: what does lives = 0 evaluate to when lives is 2, and when lives is 0? For each one, what would IF lives = 0 THEN do with that value?
Flashcards
(10)What is the Boolean data type?
Name four common data types.
How do you know data should be stored as a Boolean?
Why is the colour of a traffic light not a Boolean?
What does a comparison such as x > 3 evaluate to?
What does 5 > 5 evaluate to?
How does an IF statement use a Boolean?
When does a WHILE loop check its condition?
What is a Boolean flag?
What is the difference between True and "True"?
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 29 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.