Coding · Grade 6
Conditions and Boolean Logic
Learners use comparisons to ask True/False questions, trace if, elif and else to see which single branch runs, and combine conditions with and, or and not using truth tables. A reading-club badge program shows why the order of an elif chain matters and how boundary values reveal decision bugs.
- 4 lessons
- About 80 minutes
- Check what you learned: 8 questions
- Ways to answer: fill in the blanks, choose an answer, put code in order, trace code and sort into groups
What learners will discover
- Evaluate comparisons to True or False and tell == (compare) from = (store).
- Trace if, elif and else statements and predict which branch runs, including at boundary values.
- Combine conditions with and, or and not, and evaluate them using a truth table.
- Order the branches of an elif chain correctly and choose boundary tests to find decision bugs.
Lessons
-
Comparisons are questions with True or False answers 6 steps3 practiceabout 18 min
-
if, elif and else 6 steps4 practiceabout 20 min
-
and, or, not 6 steps4 practiceabout 20 min
-
Order matters: elif chains and boundaries 6 steps3 practiceabout 18 min
-
Check what you learned 8 questions at the end
Keep exploring
Games to practice with
- Robot RoutesSnap together arrow, repeat and dance blocks to guide Bolt the robot home.
- Bug DetectiveA robot program almost works. Run it, spot the buggy block, and fix it.
- Sorting FactoryTurn a work order into if/else rules and watch the conveyor sort every item.
More 6th grade coding
- 6th Grade Coding Games5 games to play free
- 6th Grade Coding Worksheets10 printable worksheets
Guide for grown-ups
- How to start homeschooling: a step-by-step guide for familiesA guide for parents · 7 min read