Computing · Stage 6

Lists & Functions

Programs & Judgement · lists & functions · store many values in one list and package reusable steps in a function with parameters

✦ Computing📘 Stage 6 · S6⏱ ~14 min🧒 Ages 10–12★ Free to start
I can use lists and write functions with parameters.
Kavi the owl for Computing
📖

Kavi's Big Box of Boxes

Kavi had 24 star stickers in 24 tiny jars — one sticker per jar. "This is silly," Kavi hooted. "I need one name for all of them!" So Kavi made a list: one name, many values, kept in order. Then Kavi spotted something else — the same three steps, copied again and again and again. "I'll wrap them in a function," said Kavi, "give it a parameter so it works for anything, and call it whenever I like!" One list to hold many things. One function to reuse many steps. "Now," grinned Kavi, "I can build something big — without writing the same thing twice."

🎓

What your child will learn

1A list: one name, many values, kept in orderA plain variable holds one value. A list holds many values under a single name — like scores = [8, 5, 9, 7]. Tap each part to learn its job.
2One list, one function, no copied stepsHere is a tiny program. It makes a list of names, writes a function that greets any name, then calls that function once for every item in the list. Press ▶ Run and watch it work.
3List job or Function job?
4Read the list, call the functionRead each little piece of code, work it out in your head, and predict the result. Reveal to check, then try the next one.
🔍

A peek inside

Kavi keeps all the test scores in one list: scores = [8, 6, 9, 7, 10]. How many values does the list hold, and what is the first one?
count the values inside the brackets: 8, 6, 9, 7, 10 — that is 5 values; the first value written is 8

Try this at home: A thing that stores many values in order under one name is called a ____.

Ready to play and learn?

Start the free interactive lesson, or print the handout for screen-free play.

Part of Computing · Stage 6 · S6 on KAVI Academy — a secular, whole-child learning platform for ages 5–12.