Skip to content
PlayOwl

Coding · Grade 8

Functions, Modules and Structured Data

Learners design functions that are easy for teammates to use (default and keyword arguments, docstrings, returning several values), organise code into modules and use the standard library, represent real data as lists of dictionary records with nested fields, and process records with filter, aggregate, transform and key-based sorting.

  • 4 lessons
  • About 85 minutes
  • Check what you learned: 8 questions
  • Ways to answer: fill in the blanks, choose an answer, put code in order, trace code, match pairs and type a number
Try it now (no account) One of the five free starter courses Open in PlayOwl

What learners will discover

  • Write and call functions with default parameters, keyword arguments, docstrings and multiple return values.
  • Organise code into modules and use import, from-import and standard-library modules such as math.
  • Represent records as dictionaries in lists and access nested fields correctly.
  • Process lists of records by filtering, aggregating, transforming and sorting with a key function.

Lessons

  1. Designing better functions 7 steps4 practiceabout 22 min
  2. Modules and imports 5 steps3 practiceabout 20 min
  3. Records and nested data 5 steps3 practiceabout 20 min
  4. Processing structured data 6 steps3 practiceabout 20 min
  5. Check what you learned 8 questions at the end

Keep exploring

Games to practice with

More 8th grade coding

Guide for grown-ups