Tutorpip← About this lessonABCHide the answer keyDownload PDF
Coding · Ages 10+ · Set A
Zara's first line of Python
Scan to mark
on screen
A
Name
Date
Start Finish
Goal: 15 min
Score/ 11
Remember: Python reads one line at a time, top to bottom. Print shows the text inside the quotes, and an error message is a clue.

Read and answer

Read the story, then answer.

Bo learns to say helloAt Robot Club, Zara wants Bo to greet every visitor. Ms. Ito says the language is called Python, and a computer reads it one line at a time. Zara types print("Hello") and runs it, and Bo's screen shows the word Hello. She adds a second line, and Python reads line one and then line two, from the top down. Leo tries his own line, but he forgets the last quote. A message pops up and points at his line. Zara says it is an error message, and it is a clue, not a telling-off.
1
Zara runs print("Hello"). What does Bo's screen show?
⌨️print("Hello")👋Hello🚫Nothing at all
2
Python reads a program from the line down.
toplastmiddle
3
The word print is a command that shows something on the screen.
TrueFalse
4
Zara runs this two-line program. What does Bo's screen show?
Hello, then I am BoI am Bo, then HelloHello and I am Bo are never shown
5
One of these lines has a mix-up to fix. Which one?
print("I am Bo")print("Hi Zara")Print("Hello")
6
Python reads a program from the bottom up.
TrueFalse

Match, order and fix

7
Join each piece to what it is.
  1. 1print
  2. 2"Hello"
  3. 3input
  • Atext, because of the quotes
  • Ba command that asks a person to type
  • Ca command that shows a message
8
Zara runs her two-line program. Put what happens in order.
  • Python reads line two
  • Bo's screen shows I am Bo
  • Bo's screen shows Hello
  • Python reads line one
9
Leo types print("Hello Leo) and the message points at it. What is the mix-up to fix?
The closing quote is missingThe word print needs a capital letterThe brackets are not needed
10
An error message means the computer is broken.
TrueFalse
11
Text goes inside so Python knows it is text.
quotesnumberscommas
12
Write a line of Python that shows the word robot on the screen.
13
Draw Bo's screen after the line print("Hi Zara") runs.
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.
Answer key · Set A
Zara's first line of Python
1Hello Print shows only what is inside the quotes, so the screen shows the word Hello.
2top Python starts at the top line and reads down, one line at a time.
3True Print tells the computer to show a message.
4Hello, then I am Bo Python reads line 1 first and line 2 next, so Hello comes before I am Bo.
5Print("Hello") Python needs a small letter p in print, so Print with a capital P is a mix-up to fix.
6False Python reads from the top line down.
71-C, 2-A, 3-B Print and input are commands. Anything inside quotes is text.
83, 4, 2, 1 Python reads one line at a time from the top, and each line shows its message before the next is read.
9The closing quote is missing The opening quote has no closing quote. Add it back: print("Hello Leo").
10False An error message is a clue that points at the line to fix. The computer is fine.
11quotes Quotes tell Python that something is text.
12Your own words: a grown-up reads it.
Mark each answer, count the right ones and write the score on the sheet.