You take the Unit 2 test in class today. This page is everything you can do before it — what’s on it, how to revise, and practice that isn’t on the real test. There are no test questions here.
No new reading. Everything on the test comes from 2.1–2.18. The fastest revision is the drill in 2.19, not re-reading.
Last stop in Programs for now. The test is a checkpoint on four weeks, not a new idea. Next unit you keep writing programs — but you teach them to repeat steps with loops.
The multiple-choice questions spread across the unit in roughly these proportions. This is the map of where the points are — study to it.
| What it tests | From | Roughly |
|---|---|---|
| Assignment sequences (trace the variables) | 2.2 | 2–3 Q |
Expressions and MOD (%, even/odd, last digit) | 2.3 | 2–3 Q |
| Strings and f-strings | 2.6, 2.7 | 1–2 Q |
Booleans and comparisons (= vs ==) | 2.11 | 2 Q |
| if / else and elif chains (trace which branch) | 2.12, 2.13 | 3–4 Q |
| Nested conditionals (deeper traces) | 2.13 | 2 Q |
| Logical operators AND / OR / NOT | 2.14 | 2–3 Q |
| Error types and edge cases | 2.8, 2.16 | 1–2 Q |
Retrieval beats re-reading. Make yourself produce the answer before you check. Here’s the order that pays off fastest:
1. Say the unit in one breath (2 min). “A program stores values, computes, talks to the user, and makes decisions.” Expand each. Where you stall is what to study.
2. Run the five traps (5 min). Below — the pairs that cost the most marks.
3. Drill traces cold (5 min). The 2.19 trace race, especially the pseudocode ones.
4. Take the practice set (8 min). Section 4 — fresh questions, none on the real test.
Every one has cost real students real points. Thirty seconds each:
| Don’t confuse | The one-line difference |
|---|---|
= vs == | One = assigns (puts a value in the box). Two == compares (asks if equal). |
/ vs % | / divides; % (MOD) keeps the remainder. n % 2 == 0 is the even test. |
| if/elif chain vs separate ifs | A chain stops at the first True; separate ifs each fire, so several can run. |
| and vs or | and needs both True; or needs just one. Only and fails when one side is False. |
| syntax vs run-time vs logic error | Syntax = won’t run; run-time = crashes mid-run; logic = runs but wrong. |
Want the interactive version? Lesson 2.19 has the map rebuild and the full trace race — the single best 15 minutes of revision on the site.
Six mixed questions in AP format, sampled across the unit, several in pseudocode only. None of these is on the real test — they’re for calibration. Pick an answer to see feedback immediately.
Prompt. Explain what this program does and its purpose. Write three or four sentences — describe the overall job, not each line in turn.
# mystery program
n = int(input("Number? "))
count = 0
if n % 2 == 0:
count = count + 1
if n % 7 == 0:
count = count + 1
print(count)
Write your answer before you open the checklist below.
□ Names the overall job. It counts how many of two properties a number has — being even and being a multiple of 7 — and prints that count (0, 1, or 2).
□ Explains the conditionals’ role. Each if tests one condition with MOD; when the condition is True, that branch adds 1 to the running count variable.
□ States the purpose, not the syntax. “It reports how many of these two divisibility rules the input satisfies” — not “line 3 checks n mod 2.”
□ Uses terms correctly. condition, variable, expression — each meaning what it should. (For the curious: input 14 prints 2; input 9 prints 0.)
Describe purpose, not mechanics. “It counts divisibility properties” beats a line-by-line retelling. Saying what a program is for, in a sentence, is exactly what the Create PT written responses reward.