Python for Kids · Class 7 · Module 6 of 9

Text and Files

Close the program and the data vanishes — unless you wrote it down.

8 sessionsSessions 41–48
4 weeksTypical pace
Foundation to IntermediateLevel
Class 7Python & Coding
An open journal file with dated entries and a save badge
The big idea

Files give programs a memory that outlives a single run. Alongside file handling, students sharpen string methods for cleaning and searching text, so saved records are actually usable later.

Why it matters

Persistence is the difference between a toy and a tool. A journal that forgets everything on exit is not a journal.

Unpacked

What you will actually learn

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

01

String methods

String methods slice, strip, split, join and search text. Most real data arrives messy, and cleaning it is a genuine everyday programming job.

02

Reading and writing text

Reading and writing text means opening a file, doing the work and closing it properly — which is why the with statement exists and why professionals always use it.

03

Simple records

Simple records mean choosing a consistent line format, such as date | mood | note, so the program can read back exactly what it wrote.

Did you know?

Opening a file in "w" mode erases everything already in it, instantly and without asking. "a" for append is the safer choice — and a lesson usually learned once.

Common mix-up

“Saving happens automatically.” Data sits in memory until it is written and the file is closed. Crash before that and it is simply gone.

Session by session

Your 8-session journey

Sessions 4148 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 string methods.

  2. 2

    String methods

    Guided teaching on string methods, worked through together with the teacher.

  3. 3

    String methods — practice lab

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

  4. 4

    Reading and writing text

    Guided teaching on reading and writing text, building directly on the previous two sessions.

  5. 5

    Reading and writing text — practice lab

    Applied tasks that combine string methods and reading and writing text in one piece of work.

  6. 6

    Simple records

    Simple records introduced and practised, completing the toolkit needed for the project.

  7. 7

    Project build

    Guided build session for the module project: Digital journal.

  8. 8

    Test, present and reflect

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

Project lab

Digital journal

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 48.

Try this at home

Build a journal that appends a dated entry each time you run it, then add a search that prints every entry containing a chosen word.

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 6 can:

  • Explain and use string methods without prompting
  • Explain and use reading and writing text without prompting
  • Explain and use simple records without prompting
  • Build and finish digital journal
  • 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:

file mode
Whether a file is opened to read, write or append.
persistence
Keeping data after a program stops running.
parse
To read text and pull structured meaning out of it.
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.