Skip to content
PlayOwl

Coding · Grade 6

Lists, Tests and Debugging

Learners store many values in Python lists, use zero-based and negative indexes, and loop over lists to total, count and find the largest value. They then test a function by comparing expected and actual results, design edge-case tests that catch hidden buggy versions, and debug using error messages, tracing and temporary prints.

  • 4 lessons
  • About 85 minutes
  • Check what you learned: 8 questions
  • Ways to answer: choose an answer, put code in order, trace code, highlight a text, match pairs and type a number
See plans Included with Family, Teacher and School plans. Open in PlayOwl

What learners will discover

  • Create and change lists using indexes from 0 (and -1 for the last element), len() and append().
  • Loop over a list to total values, count matching values and find the largest value.
  • Test a function by comparing expected and actual results, choosing normal and edge cases that catch bugs.
  • Use error messages, tracing and temporary prints to find and fix bugs.

Lessons

  1. Lists and indexes 6 steps3 practiceabout 18 min
  2. Looping over lists 6 steps4 practiceabout 20 min
  3. Testing: expected versus actual 5 steps2 practiceabout 22 min
  4. Reading error messages and debugging 5 steps3 practiceabout 20 min
  5. Check what you learned 8 questions at the end

Keep exploring

Games to practice with

More 6th grade coding

Guide for grown-ups