Coding · Grade 6
Input, Output and Variables
Learners see assignment as an instruction (work out the right side, then store), read user input with input() and convert it with int() and float(), format output with f-strings and choose valid, meaningful names. They finish by tracing complete programs, including the classic swap bug and its fix.
- 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, highlight a text and type a number
What learners will discover
- Explain assignment: the right-hand side is worked out first, then stored, replacing the variable's old value.
- Read user input with input() and convert it with int() or float() before doing maths.
- Produce clear output with f-strings and choose valid, meaningful variable names.
- Trace programs that read input and update variables, including swapping two values with a temporary variable.
Lessons
-
Variables and assignment 6 steps3 practiceabout 18 min
-
Input and type conversion 6 steps4 practiceabout 20 min
-
Clear output and good names 6 steps4 practiceabout 18 min
-
Tracing whole programs 6 steps3 practiceabout 19 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