Remember: Input waits for a person and keeps what they type as text. Wrap it in int to get a whole number, and use print to show it.
Read and answer
Read the story, then answer.
Zara's boothOpen day comes, and Zara sets up a booth with Bo and a laptop. She wants the program to greet each visitor by name, but Python cannot know who will come, so it has to ask. A command called input puts a question on the screen and waits. A visitor called Mia types her name and presses Enter. Only then does Python carry on, and the answer goes into a box called name. Input only keeps the answer, so a print line is needed to show it. Next Zara asks for an age and tries to add one. A message says Python cannot add a number to text. The fix is a command called int, which turns text into a whole number.
1
Python reaches an input line. What does it do?
🏃It keeps going and guesses the answer⏳It waits until the person types and presses Enter🖥️It shows the answer by itself
2
The typed answer is kept in a box called a .
quotecommandvariable
3
Input shows what the person typed on the screen by itself.
TrueFalse
4
Mia types 12 into this line. What is in the box age?
The number 12An error messageThe text 12
5
Mia types 3 into the line pets = int(input("Pets? ")). What is in the box pets?
The number 3The text 3Nothing yet
6
Whatever a person types arrives as text, even digits.
TrueFalse
Match, order and fix
7
Join each word to its job.
1input
2print
3int
4a variable
Akeeps the typed answer in a box
Bturns text into a whole number
Casks a question and waits for typing
Dshows a message on the screen
8
Mia uses the booth. Put what happens in order.
Mia types her name and presses Enter
The answer goes into the box called name
The program says hi to Mia
Python waits
The program shows the question
9
One of these lines has a mix-up to fix. Which one?
Mia types twelve and int turns it into a number. Zara adds one, and twelve plus one is .
11
Python keeps running while it waits for a person to type.
TrueFalse
12
Write an input line that asks a visitor for a favorite color.
13
Draw a box with the word name on it, and a visitor's answer inside.
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.