Tutorpip← About this lessonAWith the answer keyDownload PDF
Coding · Ages 10+ · Set A
Mina teaches Bo to cheer
Scan to mark
on screen
A
Name
Date
Start Finish
Goal: 15 min
Score/ 11
Remember: A function is a named bundle of lines. Def writes it down, a call runs it, and a parameter is a blank you fill in.

Read and answer

Read the story, then answer.

The finaleBo's finale is a spin, a clap and a bow, and it happens three times in the show. Mina typed the three moves three times and had nine lines. Then she wanted a deeper bow, so she had to fix it three times. Ms. Ola says a function is a bundle of lines with a name. Mina writes def cheer(): and pushes the moves in under it. When she runs it, Bo stands still, because def only writes the recipe down. To make Bo cheer, Mina calls the function by writing cheer() on a line of its own. Later she makes a function with a blank, a parameter: greet("Bo") says hi Bo, and greet("Teo") says hi Teo.
1
A program has only the def cheer lines and no line that calls cheer. What does Bo do?
🔄Bo spins three times🧍Bo does nothing, because def only writes the recipe down🙇Bo bows once
2
A function runs only when it is by its name.
writtencalledsaved
3
Def writes a function down, and a call runs it.
TrueFalse
4
Which line is the call that makes Bo cheer?
line 1line 5line 3
5
A program has the def lines and then the line cheer() written three times. How many times does Bo cheer?
OnceNine timesThree times
6
To make the bow deeper in all three cheers, Mina must fix it in three places.
TrueFalse

Match, order and fix

7
Join each word to what it means.
  1. 1def
  2. 2a call
  3. 3a parameter
  4. 4lines pushed in
  • Aruns the function by its name
  • Bwrites the function down
  • Cbelong to the function
  • Da blank the call fills in
8
Put Mina's steps in order.
  • Bo spins, claps and bows
  • Run the program
  • Add the line cheer() to call it
  • Write def cheer(): with the moves pushed in
9
greet("Teo") is called. Using the same recipe as greet("Bo"), what does it say?
hi Bohi greethi Teo
10
The word inside the brackets, like "Bo" in greet("Bo"), fills in a blank called a .
parameterrecipeloop
11
Teo writes def dance(): with three moves under it and runs the program. Bo stands still. What is the mix-up to fix?
No line calls dance()The word def must be a capital letterThe moves need to be written three times
12
Think of a routine such as tidy up. Write its name and the three steps it would hold.
13
Draw a recipe card: put the function's name on top and its steps below.
Scan the code at the top to mark this sheet on screenTake a photo of your answers or type them. It is marked for you automatically, and your score is kept.