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 | |
|---|---|---|
| 1score <- 0 | Afor i in range(1, 6): | |
| 2name = input("Name? ") | Bif score > 5: | |
| 3Pseudocode IF score > 5 THEN becomes an if line ending with a colon | CThe pseudocode arrow <- was copied into Python. Python needs = instead: score = 0 | |
| 4Pseudocode FOR i <- 1 TO 5 becomes a for loop with range(1, 6) | DThe if line is missing its colon, and the print line is not indented. END IF is shown by un-indenting, not by a keyword. | |
| 5score <- 0 | EPseudocode assignment arrow: in Python it becomes score = 0 | |
| 6if age >= 13 print("Teen") | FPython version of the pseudocode step INPUT name |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
score <- 0 becomes score = 0 — Pseudocode steps map to Python lines: <- becomes =, input becomes input(), if becomes if with a colon, for becomes for in range(). END IF becomes un-indenting.score = 0name = input("Your name? ")if score >= 10:
print("You win!")for i in range(1, 6):
print(i)if age >= 12 and age <= 15:
print("Teen")