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.

Topic 1.12 · AND, OR and NOT10 fillable worksheet pagesRead at your own pace

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.

Today’s two goals
  • 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.
Original PaxaKids illustration for AND, OR and NOT. Use the supplied program and data models for precise workbook facts.
An original PaxaKids workbook scene. Use the supplied programs and data for precise workbook facts.

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

A comparison produces a Boolean result: True or False. Boolean operations combine or reverse these results. With Boolean operands, AND is True only when both are True; inclusive OR is True when one or both are True; NOT reverses one result.

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

Write True or False in each result box. A and B are Boolean operands, not arbitrary strings or numbers. Every pair is included, so the table also checks unsuccessful cases.
Complete every Boolean combination — original model
ABA AND BA OR BNOT ANOT B
FalseFalse{'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']}
FalseTrue{'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']}
TrueFalse{'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']}
TrueTrue{'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

The complete condition is (count > 10) AND (count < 20). Each comparison refers to count. First record each comparison’s truth value, then combine those values using AND.
Replace comparisons before applying AND — original model
countcount > 10count < 20AND 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

At the fictional exhibition, either a valid ticket OR a booking can satisfy the entry rule. If both are present, the OR condition is still True.

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

For this original supplies example, remaining is a nonnegative whole-number count. The comparison remaining == 0 detects none remaining. NOT reverses that Boolean result. The nonnegative domain matters when interpreting a nonzero count as some remaining.
ORIGINAL SUPPLIES PLAN
INPUT remaining
IF NOT (remaining == 0) THEN
    OUTPUT "Some remaining"
ELSE
    OUTPUT "None remaining"
ENDIF

Compare original plans A and B

Both plans store a value in result but do not display it. Trace the stored value. The supplied Python checking files add print(result) after the block so you can observe it; that extra output is labelled as a checking aid.
PLAN A: NOT
INPUT colour
IF NOT (colour == "teal") THEN
    result <- 7
ELSE
    result <- 9
ENDIF
PLAN B: OR
INPUT colour
IF colour == "teal" OR colour == "coral" THEN
    result <- 7
ELSE
    result <- 9
ENDIF

Trace two inputs and a retained initial value

Plan C starts result at 0. Test the ordered conditions. There is no ELSE, so an unmatched pair leaves the initial result unchanged. Compare strings exactly, including case.
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
ENDIF

Translate operations and keep operands complete

Translate operations and keep operands complete — original model
PseudocodePythonMeaning with Boolean operands
ANDandBoth operands must be True.
ORorAt least one operand is True, including both.
NOTnotReverse 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.

Paxa the Fox

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
  1. Lesson 1.1: Recall algorithms and representations
  2. Lesson 1.2: Purpose and conventions of pseudocode
  3. Lesson 1.3: Input, output and strings
  4. Lesson 1.4: Identifiers and assignment
  5. Lesson 1.5: Arithmetic and translation
  6. Lesson 1.6: Trace and review a sequence
  7. Lesson 1.7: Conditions and two-way flow
  8. Lesson 1.8: IF THEN and indentation
  9. Lesson 1.9: IF THEN ELSE and decision diagrams
  10. Lesson 1.10: Ordered ELSEIF and fallback ELSE
  11. Lesson 1.11: Match flowchart and pseudocode branches
  12. Lesson 1.12: AND, OR and NOT
  13. Lesson 1.13: Grouping, precedence and review
  14. Lesson 1.14: Why software searches
  15. Lesson 1.15: A successful linear search
  16. Lesson 1.16: An unsuccessful search and termination
  17. Lesson 1.17: Practise and communicate the search
  18. Lesson 1.18: Translate conditions into Python
  19. Lesson 1.19: One-branch IF programs
  20. Lesson 1.20: Two-way IF ELSE programs
  21. Lesson 1.21: Ordered ELIF choices
  22. Lesson 1.22: Ranges and independent decisions
  23. Lesson 1.23: Boolean operators in Python
  24. Lesson 1.24: Design and test recommendations
  25. Lesson 1.25: Trace, debug and reflect
  26. Lesson 1.26: Choose data types and recognise Boolean literals
  27. Lesson 1.27: Set and use Boolean flags
  28. Lesson 1.28: Explain and identify constants
  29. Lesson 1.29: Express constants in three algorithm forms
  30. Lesson 1.30: Use a fixed factor in a calculation
  31. Lesson 1.31: Cast to Boolean and validate an empty response
  32. Lesson 1.32: Recall calls and trace return values
  33. Lesson 1.33: Supply parameters and reuse library code
  34. Lesson 1.34: Choose and import libraries responsibly
  35. Lesson 1.35: Round with floor and ceiling
  36. Lesson 1.36: Use pi and investigate another mathematical feature
  37. Lesson 1.37: Generate random choices within bounds
  38. Lesson 1.38: Investigate random real values and review library use
  39. Lesson 1.39: Retrieve test tables and predict selection outcomes
  40. Lesson 1.40: Decompose everyday problems
  41. Lesson 1.41: Decompose programs and organise shared work
  42. Lesson 1.42: Develop through repeated build/test cycles
  43. Lesson 1.43: Predict and verify algorithm outcomes
  44. Lesson 1.44: Choose representative and boundary tests
  45. Lesson 1.45: Build, execute and review a test plan
  46. Lesson 1.46: Recall physical inputs and compare transmission media
  47. Lesson 1.47: Configure a radio group and agree a message scheme
  48. Lesson 1.48: Send and receive numbers and strings
  49. Lesson 1.49: Trace numeric message sequences
  50. Lesson 1.50: Transmit text and use received data in conditions
  51. Lesson 1.51: Diagnose and extend a message protocol
  52. Lesson 1.52: Review communication and evidence of testing
  53. Lesson 1.53: Project 1: Adventure story
  54. Lesson 1.54: Project 2: Fire, Water, Earth
  55. 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.

AND, OR and NOT10 student pages · original artwork

Opening your PDF…

Swipe sideways across the worksheet on a small screen, or use “Answer list” for larger controls.

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

Download worksheet PDF ↓

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

  1. Question 1: Which operation requires both Boolean operands to be True? AND
  2. Question 2: What is True OR True? True

Worksheet 2

  1. Question 3: False AND False False / false
  2. Question 4: False OR False False / false
  3. Question 5: NOT A when A=False, B=False True / true
  4. Question 6: NOT B when A=False, B=False True / true
  5. Question 7: False AND True False / false
  6. Question 8: False OR True True / true
  7. Question 9: NOT A when A=False, B=True True / true
  8. Question 10: NOT B when A=False, B=True False / false
  9. Question 11: True AND False False / false
  10. Question 12: True OR False True / true
  11. Question 13: NOT A when A=True, B=False False / false
  12. Question 14: NOT B when A=True, B=False True / true
  13. Question 15: True AND True True / true
  14. Question 16: True OR True True / true
  15. Question 17: NOT A when A=True, B=True False / false
  16. Question 18: NOT B when A=True, B=True False / false

Worksheet 3

  1. Question 19: count 10: > 10 False / false
  2. Question 20: count 10: < 20 True / true
  3. Question 21: count 10: (>10) AND (<20) False / false
  4. Question 22: count 15: > 10 True / true
  5. Question 23: count 15: < 20 True / true
  6. Question 24: count 15: (>10) AND (<20) True / true
  7. Question 25: count 20: > 10 True / true
  8. Question 26: count 20: < 20 False / false
  9. Question 27: count 20: (>10) AND (<20) False / false
  10. Question 28: Which count is accepted by this strict interval condition? 15
  11. Question 29: Why does count = 20 fail? count < 20 is False, so both comparisons are not True

Worksheet 4

  1. Question 30: Ticket True and booking True: what is the OR result? True
  2. Question 31: For count = 0, what is (count 12)? False
  3. Question 32: For count = 13, what is the same out-of-range condition? True

Worksheet 5

  1. Question 33: For remaining = 0, what is NOT (remaining == 0)? False
  2. Question 34: For remaining = 3, which output follows? Some remaining
  3. Question 35: What does NOT do to a False Boolean comparison? changes it to True

Worksheet 6

  1. Question 36: In Plan A, what is stored for colour = "teal"? 9
  2. Question 37: In Plan A, what is stored for colour = "coral"? 7
  3. Question 38: In Plan B, what is stored for colour = "coral"? 7

Worksheet 7

  1. Question 39: For first="coral", second="teal", what is result? 9
  2. Question 40: For first="teal", second="coral", what is result? 7
  3. Question 41: For first="coral", second="indigo", what is result? 0

Worksheet 8

  1. Question 42: Which condition correctly accepts exactly count 2 or count 3? (count == 2) OR (count == 3)
  2. Question 43: Which statement about Plan C is accurate? if neither branch assigns result, it stays 0

Worksheet 9

  1. 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

  1. 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.
Back to my workbook ↑

Curriculum & workbook reference

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.