print() with Highlight.

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

print() with Highlight.

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Does Highlight. change the background highlight colour of the displayed text?
A True
B False
2. Should the colour name after the dot be written in quotation marks?
A False
B True
3. Should Highlight start with an uppercase or lowercase H?
A Lowercase
B Uppercase
4. Should Highlight.red be joined to a string with + or a comma?
A +
B Comma
5. Is HIGHLIGHT written fully in uppercase valid in this system?
A True
B False

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1print(Highlight.yellow + "Level up!") ADisplays the text with a yellow highlight
2print(Highlight.red + "Warning!") BThe colour name should not be written in quotation marks
3A value joined with + to a string to change its background highlight colour CHighlight.
4The word after the dot specifying which highlight colour to use DHighlight.blue
5print(highlight.red + "Warning!") EDisplays the text with a red highlight
6print(Highlight."red" + "Game Over") FHighlight should start with an uppercase H, not lowercase highlight

Definitions

Highlight.yellow

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
print(_________.yellow + "Level up!")
2.
print(Highlight.___ + "Warning!")
3.
print(Highlight.____ + "Great job!")
4.
_____(Highlight.gold + "Score: 100")
5.
print(Highlight.______ + "Bye!")

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A highlight.red used in this line
B print(Highlight.blue + "Hello!")
C print(Highlight.green + "Great!")
Question 2
A print(Highlight.gold + "Level up!")
B print(Highlight."red" + "Game Over")
C print(Highlight.green + "Success")
Question 3
A print(Highlight.blue + "Start")
B print(Highlight.orange + "Middle")
C print(Highlight.purple + "End"
Question 4
A print(Highlight.yellow, "Set")
B print(Highlight.green + "Ready")
C print(Highlight.red + "Go")
Question 5
A print(Highlight.grey + "Loading...")
B print(HIGHLIGHT.red + "Error")
C print(Highlight.green + "Complete")

Answer Key

print() with Highlight.
Section A: Quick Questions
Q1
A — True
Q2
A — False
Q3
B — Uppercase
Q4
A — +
Q5
B — False
Section B: Match the Pairs
Q1
print(Highlight.yellow + "Level up!") → Displays the text with a yellow highlight
Q2
print(Highlight.red + "Warning!") → Displays the text with a red highlight
Q3
A value joined with + to a string to change its background highlight colour → Highlight.
Q4
The word after the dot specifying which highlight colour to use → Highlight.blue
Q5
print(highlight.red + "Warning!") → Highlight should start with an uppercase H, not lowercase highlight
Q6
print(Highlight."red" + "Game Over") → The colour name should not be written in quotation marks
Section C: Definitions
Q1
Highlight.yellow — A value joined to a string with + inside print() to change the background highlight colour of the displayed text
Section D: Fill in the Blanks
Q1
print(Highlight.yellow + "Level up!")
Q2
print(Highlight.red + "Warning!")
Q3
print(Highlight.blue + "Great job!")
Q4
print(Highlight.gold + "Score: 100")
Q5
print(Highlight.purple + "Bye!")
Section E: Spot the Error
Q1
A — Highlight must start with a capital H, not lowercase highlight.
Q2
B — Highlight values are not written in quotation marks — it should read Highlight.red.
Q3
C — This line is missing its closing bracket — it should read print(Highlight.purple + "End").
Q4
A — Highlight and the string should be joined with +, not a comma — it should read Highlight.yellow + "Set".
Q5
B — Only the first letter of Highlight should be capitalised — it should read Highlight.red, not HIGHLIGHT.red.