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.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1if score == 10: | Aif answer == 5: | |
| 2else: | BThe colon is missing at the end of the if line. Python needs it where the Scratch block opens. | |
| 3The blocks inside a Scratch if block become lines indented under the if line | CA single = is used for the Scratch equals check, but Python needs == to compare two values. A single = is for assignment. | |
| 4The Scratch = in a hexagon checks if two things are equal, so Python uses == in the comparison | Dif lives == 0: print("Game over") | |
| 5if score = 10: | EThe 'else' part of a Scratch if-else block, followed by a colon and indented lines for the blocks inside | |
| 6if score == 10 print("Win") | FThe Scratch block 'if score = 10 then' written in Python: the hexagon becomes a comparison, followed by a colon |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
if score == 10: — Python's version of Scratch's if block: the hexagon condition becomes a comparison like ==, then a colon, and the blocks inside become indented lines. Add else: for the else part.if score == 10:
print("You win!")if score == 10:
print("You win!")if score == 10:
print("Win")
else:if age >= 13:
print("Teen")
else:if score == 10:
print("You win!")
else: