Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
"Hello" + "World"?"Hi " + "there"?name = "Alice", what is "Hi " + name?"Good" + "bye"?"Hello" + " " + "World"?Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1'Hello' + 5 | AOutput: catnap | |
| 2name = 'Ali' print('Hi' + name) | BError: Missing space | |
| 3'Hello' + ' ' + 'World' | CValid: Hello World | |
| 4greeting = 'Hi ' result = greeting + 'Bob' | DOk: Concatenate variables | |
| 5print('cat' + 'nap') | EOutput: HotDog | |
| 6a = 'Hot' b = 'Dog' print(a + b) | FError: str + int not allowed |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
"Hello" + "World" — Concatenation joins strings with + but no space is added.~~"Hello" + " " + "World"result = "Hello" + "World"name = "Alice"
message = "Hi " + name
print(message)greeting = "Good" + " " + "morning"first = "Bob"
last = "Smith"
fullname = first + " " + lastcity = "Melbourne"
sentence = "I live in " + city
print(sentence)