Every condition in a program is either true or false. Logic words — AND, OR and NOT — combine conditions: AND needs both parts true, OR needs at least one, and NOT flips true to false.
What your child will learn
- Decide whether simple statements are true or false
- Use AND: both parts must be true
- Use OR: at least one part must be true
- Use NOT to reverse a condition
AND, OR, NOT
“The number is more than 2 AND less than 6” is true for 3, 4 and 5 only. “Less than 2 OR more than 6” is true for 0, 1, 7, 8 and up. A game might give a bonus only if score > 100 AND lives > 0 — miss either and there’s no bonus.
Example questions
Here are a few questions like the ones in the first quest. Can you solve them?
1. In coding, a condition is always either…
- big or small
- true or false
- red or blue
- up or down
Show answer
Answer: true or false. Conditions are checked as true or false.
2. True or false: 2 > 9
- False
- True
Show answer
Answer: False. 2 is not greater than 9.
3. “You can have juice OR milk” means…
- you must have both
- you get water
- you get neither
- you can choose either one
Show answer
Answer: you can choose either one. OR is true if at least one part is true.
4. True or false? (OR)
- false OR false
- false OR true
- true OR true
- true OR false
Baskets: True · False
Show answer
Answer: True: false OR true, true OR false, true OR true · False: false OR false. OR is true when at least one side is true.
Tips for grown-ups
- Play “Stand up if you have a pet AND you like apples”, then try OR.
- Ask true-or-false questions at dinner: “Broccoli is blue OR carrots are orange.”