Lesson overview
Combine true or false conditions using AND, OR and NOT.
Focus: Boolean logic and conditions.
What you will learn
- Explain that Boolean expressions evaluate to true or false.
- Use AND when both conditions must be true.
- Use OR when at least one condition must be true.
- Use NOT to reverse a condition.
Before you start
- Comparison operators.
- Selection and loops.
- Basic truth table reading helps but is not required.
Boolean condition scenarios
Use the login, ticket discount and game examples below to choose AND, OR or NOT.
Boolean logic and conditions infographic

Explanation
A condition is an expression that evaluates to true or false. Programs use conditions to choose paths and control loops.
AND means both parts must be true. OR means at least one part must be true. NOT reverses true to false or false to true.
Boolean logic becomes easier if you test each part separately before combining the result.
Worked examples
Login condition
usernameCorrect is true.
passwordCorrect is false.
usernameCorrect AND passwordCorrect evaluates to false.
Answer: Access should not be allowed because both checks are not true.
Quick checks
1. What does true AND false evaluate to?
- a. true
- b. maybe
- c. false
Reveal answer
Answer: c. Correct. AND needs both sides to be true.
Not quite. AND is strict.
2. What does true OR false evaluate to?
- a. true
- b. false
- c. error
Reveal answer
Answer: a. Correct. OR needs at least one side to be true.
Not quite. OR accepts either true condition.
Practice
1. A discount applies if age < 16 OR hasVoucher is true. age < 16 is false and hasVoucher is true. Does the discount apply?
Reveal answer
Answer: Yes, because OR has one true side.
Marking: Credit true result and reason.
2. A login requires usernameOK AND passwordOK. usernameOK is true and passwordOK is true. Is login allowed?
Reveal answer
Answer: Yes.
Marking: Credit AND with both conditions true.
3. If isBanned is false, what is NOT isBanned?
Reveal answer
Answer: true.
Marking: Credit logical negation.
4. Why should complex conditions be tested carefully?
Reveal answer
Answer: Small logic mistakes can send the program down the wrong branch or make a loop behave incorrectly.
Marking: Credit branch/loop behaviour and error prevention.
Exam practice ladder
- Fluency: recall the key term and use it accurately.
- Application: apply the idea to the scenario rather than giving a generic definition.
- Algorithmic reasoning: show the steps, condition or variable change clearly.
- Evaluation: explain why one method, structure or control is suitable.
Answers and marking guidance
Exact answers and marking guidance are hidden under each question. For this lesson, earn marks by naming the correct Computer Science idea, applying it to the scenario and showing the logic or value change clearly.
Common mistakes
- Using AND when either condition should be enough.
- Using OR when both checks are required.
- Forgetting that NOT reverses the condition.
- Trying to evaluate a whole condition before checking each part.
Extension
Create a condition for allowing a user into a members-only page if they are logged in and not banned.
Next lesson
Next, continue with Count-controlled Loops.
Exam-board guidance
Aplailasain is an independent learning resource and is not endorsed by any exam board.
AQA GCSE Computer Science
AQA GCSE Computer Science: this skill supports problem solving, clear algorithms and accurate programming explanations.
OCR GCSE Computer Science
OCR GCSE Computer Science: expect precise algorithm reasoning, trace work and careful use of programming vocabulary.
Pearson Edexcel GCSE Computer Science
Pearson Edexcel GCSE Computer Science: practise explaining the method as well as giving the final answer or code.
Eduqas GCSE Computer Science
Eduqas GCSE Computer Science: secure the transferable idea first, then check how your class applies it in tasks.
WJEC Wales
WJEC Wales: use accurate terminology and show enough working for the examiner to follow your logic.
CCEA
CCEA: connect the idea to your class route and use the same algorithm, programming or systems vocabulary your teacher uses.