Python for Kids · Class 8 · Module 3 of 9

Functions and Modules

Stop rewriting your best code. Package it and import it instead.

8 sessionsSessions 17–24
4 weeksTypical pace
Foundation to IntermediateLevel
Class 8Python & Coding
A package box of reusable tools with an import arrow
The big idea

Students design functions with clear responsibilities, then move them into their own module file and import them into new projects — the exact mechanism behind every Python library in existence.

Why it matters

Understanding import demystifies the whole ecosystem. A library stops being magic and becomes somebody else’s functions in a file.

Unpacked

What you will actually learn

Three core ideas, each taught with worked examples and then practised until it feels obvious.

01

Function design

Function design means one job per function, a name that says what it does, and no surprises hidden inside it.

02

Imports

Imports pull in code from elsewhere — the standard library, an installed package, or a file you wrote yesterday. All three work the same way.

03

Build a module

Building a module means saving related functions in one .py file and importing it. Your code becomes a tool other projects can use.

Did you know?

Typing “import this” into Python prints The Zen of Python — twenty design principles hidden inside the language as an easter egg since 2004.

Common mix-up

“Libraries are made by companies.” Most are written by individuals, in ordinary .py files, and shared exactly the way students do it here.

Session by session

Your 8-session journey

Sessions 1724 of the 72-session year, at two one-hour sessions per week.

  1. 1

    Warm-up and big picture

    Where this module fits, what you will build, and a hands-on starter that gets everyone curious about function design.

  2. 2

    Function design

    Guided teaching on function design, worked through together with the teacher.

  3. 3

    Function design — practice lab

    Independent practice, small challenges and one deliberate mistake to diagnose.

  4. 4

    Imports

    Guided teaching on imports, building directly on the previous two sessions.

  5. 5

    Imports — practice lab

    Applied tasks that combine function design and imports in one piece of work.

  6. 6

    Build a module

    Build a module introduced and practised, completing the toolkit needed for the project.

  7. 7

    Project build

    Guided build session for the module project: Personal utility package.

  8. 8

    Test, present and reflect

    Finish, test against the checklist, present the work and explain the decisions behind it.

Project lab

Personal utility package

Every module ends with something the student built themselves and can demonstrate. This is the piece that goes into their portfolio and gets explained out loud at the end of session 24.

Try this at home

Collect your five most-used helper functions into my_tools.py, then start a fresh project that begins with "import my_tools".

It is finished when

  • It works from start to finish without breaking
  • You can explain every part of it in your own words
  • You tested it and improved at least one thing afterwards
  • Someone else used or understood it without your help

By the end of this module

Students finishing Module 3 can:

  • Explain and use function design without prompting
  • Explain and use imports without prompting
  • Explain and use build a module without prompting
  • Build and finish personal utility package
  • Test your own work and correct what you find
  • Talk an adult through what you made and why

Word bank

The vocabulary introduced here, in plain language:

module
A .py file containing reusable code.
import
To bring code from another module into this one.
standard library
The set of modules that ship with Python.
Module challenge

Think you have got this?

0 XPLevel 1 · Curious Beginner

6 quick questions drawn from this module — vocabulary, the project you build, and a myth-or-fact round. Every wrong answer explains itself, so a mistake still teaches you something.

🎯 6 questions⚡ Up to 80 XP

Your child's free trial is one message away.

Tell us your child’s class and what they enjoy. We will suggest the closest program fit—no pressure and no upfront payment.