Remember: A string is text in quotes. Plus joins strings exactly as written, a space is a character, and len counts characters.
Read and answer
Read the story, then answer.
The badge printerZara and Leo make name badges for open day, and Bo's printer prints any text it is given. Text in quotes has a name: it is called a string. A string is a row of characters, like beads on a string, and letters, spaces and digits all count. Leo wants a badge that says Zara Bo, so Zara joins two strings with plus. The badge comes out as ZaraBo, with no space at all, because plus joins strings exactly as written. A space is a character too, and it can sit inside quotes all alone. Zara joins Zara, a space and Bo, and the badge says Zara Bo. Then Bo wants to know how long a word is, so Zara uses a tool called len, which counts the characters.
1
What does Bo's printer print for this line?
Zara BoZaraBoZara + Bo
2
What does the printer print now?
Zara BoZaraBoBo Zara
3
Text in quotes is called a string.
TrueFalse
4
How many characters does robot have?
465
5
What does this line show?
678
6
The two fives are in quotes. What does this line show?
105 555
Match, order and fix
7
Join each line to what it shows.
1print("ha" * 3)
2print("robot".upper())
3print("Bo " + "Zara")
4print(5 + 5)
Ahahaha
BBo Zara
C10
DROBOT
8
Plus joins strings exactly as written, so the space is yours to .
addcountskip
9
Put the steps in order to print Zara Bo.
Put Zara in quotes
Print it, and read Zara Bo
Add a plus and Bo in quotes
Add a plus and a space in quotes
10
This line has a mix-up to fix. What is it?
Strings cannot be taken away with a minus. Join them with plusZara needs no quotesBo needs a capital letter
11
Which line makes a badge that says Bo Zara, with a space?
Write a print line that joins Mia and Bo with a space between.
13
Draw the badge that print("Zara" + "Bo") makes.
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.