GRADE 8 · COMPUTING · UNIT 1 · LESSON 1.12
Computational thinking and programming
AND, OR and NOT
Read a little. Try the workbook. Check your answers. Choose one section below to get started.
LET’S TRACE, REASON AND TEST
AND, OR and NOT
AND requires both conditions to be true; OR requires at least one to be true; NOT reverses a Boolean result. Evaluate the comparisons before combining their Boolean meanings.
- Replace comparisons with their Boolean results and evaluate compound conditions, including unsuccessful cases.
- Explain my method and support it with a labelled trace, example or test record.

Work through an example
For count = 8, count >= 5 AND count <= 10 is true because both comparisons are true. For count = 12, the second comparison is false, so the combined condition is false.
Try before your workbook
For count = 3, is count < 2 OR count > 7 true? What is its NOT result?
Explore the clues
Tap one card to find out more.
Understand the idea
AND requires both conditions to be true; OR requires at least one to be true; NOT reverses a Boolean result. Evaluate the comparisons before combining their Boolean meanings.
Concept to practise: AND, OR and NOT.
Work through an example
For count = 8, count >= 5 AND count <= 10 is true because both comparisons are true. For count = 12, the second comparison is false, so the combined condition is false.
Try before your workbook
For count = 3, is count < 2 OR count > 7 true? What is its NOT result?
Check my readiness thinking
Both comparisons are false, so the OR result is false. NOT reverses that result to true.
Your original programs and learning models
These original PaxaKids program and data models support your workbook. Some examples deliberately contain faults to investigate. Follow their headings and preserve exact code case, punctuation and order. Traces and supplied records are not claims of physical testing.
Combine Boolean results to apply a rule
The equipment desk’s practice rule needs both membership and a charged device. Work from stated Boolean data, not details in the scene.
Complete every Boolean combination
| A | B | A AND B | A OR B | NOT A | NOT B |
|---|---|---|---|---|---|
| False | False | {'clue': 'Result', 'prompt': 'False AND False', 'answers': ['False', 'false']} | {'clue': 'Result', 'prompt': 'False OR False', 'answers': ['False', 'false']} | {'clue': 'Result', 'prompt': 'NOT A when A=False, B=False', 'answers': ['True', 'true']} | {'clue': 'Result', 'prompt': 'NOT B when A=False, B=False', 'answers': ['True', 'true']} |
| False | True | {'clue': 'Result', 'prompt': 'False AND True', 'answers': ['False', 'false']} | {'clue': 'Result', 'prompt': 'False OR True', 'answers': ['True', 'true']} | {'clue': 'Result', 'prompt': 'NOT A when A=False, B=True', 'answers': ['True', 'true']} | {'clue': 'Result', 'prompt': 'NOT B when A=False, B=True', 'answers': ['False', 'false']} |
| True | False | {'clue': 'Result', 'prompt': 'True AND False', 'answers': ['False', 'false']} | {'clue': 'Result', 'prompt': 'True OR False', 'answers': ['True', 'true']} | {'clue': 'Result', 'prompt': 'NOT A when A=True, B=False', 'answers': ['False', 'false']} | {'clue': 'Result', 'prompt': 'NOT B when A=True, B=False', 'answers': ['True', 'true']} |
| True | True | {'clue': 'Result', 'prompt': 'True AND True', 'answers': ['True', 'true']} | {'clue': 'Result', 'prompt': 'True OR True', 'answers': ['True', 'true']} | {'clue': 'Result', 'prompt': 'NOT A when A=True, B=True', 'answers': ['False', 'false']} | {'clue': 'Result', 'prompt': 'NOT B when A=True, B=True', 'answers': ['False', 'false']} |
Replace comparisons before applying AND
| count | count > 10 | count < 20 | AND result |
|---|---|---|---|
| 10 | {'clue': 'Result', 'prompt': 'count 10: > 10', 'answers': ['False', 'false']} | {'clue': 'Result', 'prompt': 'count 10: < 20', 'answers': ['True', 'true']} | {'clue': 'Result', 'prompt': 'count 10: (>10) AND (<20)', 'answers': ['False', 'false']} |
| 15 | {'clue': 'Result', 'prompt': 'count 15: > 10', 'answers': ['True', 'true']} | {'clue': 'Result', 'prompt': 'count 15: < 20', 'answers': ['True', 'true']} | {'clue': 'Result', 'prompt': 'count 15: (>10) AND (<20)', 'answers': ['True', 'true']} |
| 20 | {'clue': 'Result', 'prompt': 'count 20: > 10', 'answers': ['True', 'true']} | {'clue': 'Result', 'prompt': 'count 20: < 20', 'answers': ['False', 'false']} | {'clue': 'Result', 'prompt': 'count 20: (>10) AND (<20)', 'answers': ['False', 'false']} |
Use inclusive OR for either acceptable route
Another rule flags a count outside 0 to 12 inclusive: (count < 0) OR (count > 12). In this numeric interval, either side can detect a different out-of-range case.
Apply NOT to a complete comparison
ORIGINAL SUPPLIES PLAN
INPUT remaining
IF NOT (remaining == 0) THEN
OUTPUT "Some remaining"
ELSE
OUTPUT "None remaining"
ENDIFCompare original plans A and B
PLAN A: NOT
INPUT colour
IF NOT (colour == "teal") THEN
result <- 7
ELSE
result <- 9
ENDIFPLAN B: OR
INPUT colour
IF colour == "teal" OR colour == "coral" THEN
result <- 7
ELSE
result <- 9
ENDIFTrace two inputs and a retained initial value
ORIGINAL PLAN C: AND THEN OR
result <- 0
INPUT first
INPUT second
IF (first == "teal") AND (second == "coral") THEN
result <- 7
ELSEIF (second == "teal") OR (first == "indigo") THEN
result <- 9
ENDIFTranslate operations and keep operands complete
| Pseudocode | Python | Meaning with Boolean operands |
|---|---|---|
| AND | and | Both operands must be True. |
| OR | or | At least one operand is True, including both. |
| NOT | not | Reverse the following Boolean value. |
Files for this activity
Use these original PaxaKids practice files with the matching workbook. Work on a local copy in the appropriate editor. Some examples deliberately contain faults to investigate; a downloaded file is not a completed practical test.

Try one step with Paxa!
Trace code in the stated order and preserve exact spelling and case. Use fictional data. Label a prediction, paper trace, simulator run and physical-device test separately; an unperformed test stays Pending. Save personal responses before leaving.
Our Unit 1 learning path
- Lesson 1.1: Recall algorithms and representations
- Lesson 1.2: Purpose and conventions of pseudocode
- Lesson 1.3: Input, output and strings
- Lesson 1.4: Identifiers and assignment
- Lesson 1.5: Arithmetic and translation
- Lesson 1.6: Trace and review a sequence
- Lesson 1.7: Conditions and two-way flow
- Lesson 1.8: IF THEN and indentation
- Lesson 1.9: IF THEN ELSE and decision diagrams
- Lesson 1.10: Ordered ELSEIF and fallback ELSE
- Lesson 1.11: Match flowchart and pseudocode branches
- Lesson 1.12: AND, OR and NOT
- Lesson 1.13: Grouping, precedence and review
- Lesson 1.14: Why software searches
- Lesson 1.15: A successful linear search
- Lesson 1.16: An unsuccessful search and termination
- Lesson 1.17: Practise and communicate the search
- Lesson 1.18: Translate conditions into Python
- Lesson 1.19: One-branch IF programs
- Lesson 1.20: Two-way IF ELSE programs
- Lesson 1.21: Ordered ELIF choices
- Lesson 1.22: Ranges and independent decisions
- Lesson 1.23: Boolean operators in Python
- Lesson 1.24: Design and test recommendations
- Lesson 1.25: Trace, debug and reflect
- Lesson 1.26: Choose data types and recognise Boolean literals
- Lesson 1.27: Set and use Boolean flags
- Lesson 1.28: Explain and identify constants
- Lesson 1.29: Express constants in three algorithm forms
- Lesson 1.30: Use a fixed factor in a calculation
- Lesson 1.31: Cast to Boolean and validate an empty response
- Lesson 1.32: Recall calls and trace return values
- Lesson 1.33: Supply parameters and reuse library code
- Lesson 1.34: Choose and import libraries responsibly
- Lesson 1.35: Round with floor and ceiling
- Lesson 1.36: Use pi and investigate another mathematical feature
- Lesson 1.37: Generate random choices within bounds
- Lesson 1.38: Investigate random real values and review library use
- Lesson 1.39: Retrieve test tables and predict selection outcomes
- Lesson 1.40: Decompose everyday problems
- Lesson 1.41: Decompose programs and organise shared work
- Lesson 1.42: Develop through repeated build/test cycles
- Lesson 1.43: Predict and verify algorithm outcomes
- Lesson 1.44: Choose representative and boundary tests
- Lesson 1.45: Build, execute and review a test plan
- Lesson 1.46: Recall physical inputs and compare transmission media
- Lesson 1.47: Configure a radio group and agree a message scheme
- Lesson 1.48: Send and receive numbers and strings
- Lesson 1.49: Trace numeric message sequences
- Lesson 1.50: Transmit text and use received data in conditions
- Lesson 1.51: Diagnose and extend a message protocol
- Lesson 1.52: Review communication and evidence of testing
- Lesson 1.53: Project 1: Adventure story
- Lesson 1.54: Project 2: Fire, Water, Earth
- Lesson 1.55: Check your progress 1
For grown-ups: using this lesson
Your answers are checked in your browser. Open responses need grown-up review and are shown separately from the automatic score. Check your work, then use “Retry answers to practise” to revisit mistakes while keeping correct responses.
Read one explanation, discuss the model and try the readiness check before the workbook. Choose “Mark lesson finished” when ready. Optional account progress saves lesson position and completion across devices; save personal responses before leaving.
2. Fill in your workbook
Read the teaching and complete workbook instructions. Choose, write or draw; Answer list offers larger controls. Trace code precisely and distinguish predictions from actual tests. Review designs, explanations and drawings with a grown-up.
Opening your PDF…
Swipe sideways across the worksheet on a small screen, or use “Answer list” for larger controls.
You’ve completed the checked activities.
TAKE YOUR PRACTICE OFFLINE
3. Download the student worksheet
All 10 original A4 student pages, ready for pencil-and-paper practice. Choose Review Answers to check your work on this webpage.
Student worksheet only · PDF · 8.2 MiB · No answer key included
TRY FIRST, THEN CHECK TOGETHER
Download the student worksheet →4. Answers & guidance
Finished your try? Open the guide and compare one worksheet at a time. Your own words may be different and still explain the right idea.
Shown on this webpage only. There is no answer-key download, and this guide is left out when printing the page.
Show answers for all 10 worksheets
Worksheet 1
- Question 1: Which operation requires both Boolean operands to be True? AND
- Question 2: What is True OR True? True
Worksheet 2
- Question 3: False AND False False / false
- Question 4: False OR False False / false
- Question 5: NOT A when A=False, B=False True / true
- Question 6: NOT B when A=False, B=False True / true
- Question 7: False AND True False / false
- Question 8: False OR True True / true
- Question 9: NOT A when A=False, B=True True / true
- Question 10: NOT B when A=False, B=True False / false
- Question 11: True AND False False / false
- Question 12: True OR False True / true
- Question 13: NOT A when A=True, B=False False / false
- Question 14: NOT B when A=True, B=False True / true
- Question 15: True AND True True / true
- Question 16: True OR True True / true
- Question 17: NOT A when A=True, B=True False / false
- Question 18: NOT B when A=True, B=True False / false
Worksheet 3
- Question 19: count 10: > 10 False / false
- Question 20: count 10: < 20 True / true
- Question 21: count 10: (>10) AND (<20) False / false
- Question 22: count 15: > 10 True / true
- Question 23: count 15: < 20 True / true
- Question 24: count 15: (>10) AND (<20) True / true
- Question 25: count 20: > 10 True / true
- Question 26: count 20: < 20 False / false
- Question 27: count 20: (>10) AND (<20) False / false
- Question 28: Which count is accepted by this strict interval condition? 15
- Question 29: Why does count = 20 fail? count < 20 is False, so both comparisons are not True
Worksheet 4
- Question 30: Ticket True and booking True: what is the OR result? True
- Question 31: For count = 0, what is (count 12)? False
- Question 32: For count = 13, what is the same out-of-range condition? True
Worksheet 5
- Question 33: For remaining = 0, what is NOT (remaining == 0)? False
- Question 34: For remaining = 3, which output follows? Some remaining
- Question 35: What does NOT do to a False Boolean comparison? changes it to True
Worksheet 6
- Question 36: In Plan A, what is stored for colour = "teal"? 9
- Question 37: In Plan A, what is stored for colour = "coral"? 7
- Question 38: In Plan B, what is stored for colour = "coral"? 7
Worksheet 7
- Question 39: For first="coral", second="teal", what is result? 9
- Question 40: For first="teal", second="coral", what is result? 7
- Question 41: For first="coral", second="indigo", what is result? 0
Worksheet 8
- Question 42: Which condition correctly accepts exactly count 2 or count 3? (count == 2) OR (count == 3)
- Question 43: Which statement about Plan C is accurate? if neither branch assigns result, it stays 0
Worksheet 9
- Question 44: Design a complete decision plan for the equipment desk: lend only when member is True AND charged is True. Otherwise output "Wait". On the successful route output "Lend". Show pseudocode and a clearly labelled two-route flowchart. Check all four member/charged combinations, recording both Boolean inputs, the combined condition and exact output. Explain why replacing AND with OR changes the stated lending rule. Use a manual trace or actual run and identify any practical or partner step still Pending. Four pairs FF, FT, TF -> False/Wait; TT -> True/Lend. Require both comparisons or explicit Boolean operands, a single combined diamond or equivalent sequential decisions, output parallelograms, clearly labelled branches and Stop. AND replacement OR would incorrectly allow FT and TF. Correct Python uses and, not uppercase AND; avoid bool(input()) for textual false. Pseudocode conventions declared, exact evidence/method recorded. No numeric marks or invented real equipment/partner testing. Grown-up review; personal evidence is required.
Worksheet 10
- Question 45: For Plans A and B, identify each comparison and Boolean operation, then trace colour inputs teal, coral and lime. For Plan C, identify the two complete comparisons in each compound test. Trace the pairs (coral, teal), (teal, coral), (coral, indigo) and (indigo, lime). Show comparison truth values, selected assignment or no assignment, and final result. Explain why 0 survives an unsuccessful pair. Check by manual walk-through or the supplied Python checking files, distinguish the added print from the original stored-value plans, and record actual method, revision and Pending practical or peer work. Plan A NOT(colour==teal): teal -> False -> result 9; coral/lime -> True -> result 7. Plan B OR: teal/coral -> True ->7; lime -> False ->9. Plan C first test first==teal AND second==coral; second second==teal OR first==indigo, tested only if first test False. (coral,teal): F/F AND F then T/F OR T ->9; (teal,coral): T/T AND T ->7, second test skipped; (coral,indigo): F/F AND F, F/F OR F -> no assignment ->0; (indigo,lime): F/F AND F, F/T OR T ->9. Original plans store only; checking files add print(result). Require accurate truth substitution, preserved initial 0 and actual trace/run evidence with honest Pending stages. No numeric grading. Grown-up review; personal evidence is required.
Curriculum & workbook reference
- Cambridge Lower Secondary Computing Learner’s Book 8 — pages 50–55
- PaxaKids Grade 8 Computing Lesson 1.12: AND, OR and NOT — pages 1–10
Computing for your homeschool day
Explore AND, OR and NOT with this free Grade 8 Computing lesson. Read one idea together, try the fillable workbook and return to review at your own pace. Download the same student worksheet PDF for pencil-and-paper practice.
Fit learning around your family’s day. There is no timer and no sign-up is needed to use the lesson. An optional account saves your lesson position and completion across devices. Workbook responses and drawings stay in this tab; save a copy of your responses before leaving.
Understand your results
Closed answers are checked in your browser. Drawings and written explanations need grown-up review and are shown separately from the automatic score. Check your work, then use “Retry answers to practise” to revisit mistakes while keeping correct responses.
Choose Review Answers after trying the activity. The guide stays on the webpage; the worksheet download contains only the student pages.
For programme background, visit the Cambridge Lower Secondary Computing overview. PaxaKids provides independent original companion practice.
Book page references identify the related teaching topic. File-management and responsible-data preparation are original PaxaKids material; orientation or contents pages are not presented as teaching citations for those skills. The explanations, characters, programs and exercises here are original PaxaKids companion practice. Practical tasks require the appropriate editor and, where applicable, suitable equipment. A design or paper trace is not a verified hardware result. Only completed, reviewed lessons are listed.
Explore the Cambridge Lower Secondary Computing curriculum for programme background. PaxaKids is an independent learning resource.
