Two days. Build an interactive quiz that keeps score and reacts to how the player did — then write the paragraph that turns it into Create PT practice.
Write a program that asks the player a series of questions, keeps a running score, and finishes with a personalized result that depends on how they did. Everything from Unit 2 comes together here: input, variables, strings, and — the star of the show — conditionals.
□ A purpose sentence comment at the top.
□ At least five questions, each read with input().
□ A running score variable that starts at 0 and goes up by 1 for each correct answer (score = score + 1).
□ At least one compound condition using and or or (2.14).
□ A personalized final message built with an f-string that changes based on the score.
Copy the shape. Then write your own questions and your own result rules:
# A quiz on ___ that scores the player and # gives a personalized result. score = 0 a1 = input("Capital of France? ") if a1 == "Paris": score = score + 1 a2 = input("2 + 2 * 3 = ? ") if a2 == "8": score = score + 1 # ... three more questions ... if score >= 4 and score <= 5: print(f"{score}/5 — you passed!") else: print(f"{score}/5 — keep studying!")
# purpose: what + why # # running score starts at 0 # question 1 (input) # check the answer... # ...and count it # question 2 # note: input is text, so # compare to "8", not 8 # five total # COMPOUND condition (and) # personalized f-string # the other branch # also personalized
Hover or tap a line to light its twin. Line 6 is the classic trap:
input() returns text, so compare to "8" (quotes), not the number
8. Make yours a quiz on something you actually know.
Here is a finished Quiz Bot behaving the way yours should — a running score and a result that changes with it. Answer and watch the score climb.
One paragraph, 5–7 sentences, titled “How my conditional works.” Pick the most interesting conditional in your program — usually the compound one that decides the final result — and explain it precisely. Your teacher grades this with real PT language.
□ Identify the condition exactly — the actual Boolean expression, e.g. “score >= 4 and score <= 5” — not “it checks if they did well.”
□ Describe the result of BOTH branches — what happens when the condition is True, and what happens when it is False.
□ Use the terms correctly — condition, Boolean, and branch, each doing real work in the sentence.
score >= 4 and score <= 5 is a compound Boolean that is
True only when the score is 4 or 5. When it is True, that branch runs and prints the passing
message with the score in an f-string; when it is False, the else branch runs and
prints the ‘keep studying’ message instead. Exactly one branch runs, because the
condition has one value.”
Half the project is the paragraph. Plan your two days so writing isn’t squeezed into the last five minutes.
The Create Performance Task asks you to identify and explain a “selection” in your own program — a conditional — and to describe what it does. That is exactly the paragraph in Step 5, a full school year early. Students who practice explaining their own conditionals precisely now find the PT’s written responses almost routine in the spring.
The running-score pattern also previews Unit 3’s accumulator — a variable that builds up a result across many steps. You’re meeting the idea here with five questions; soon you’ll do it with a loop over hundreds.
Add difficulty levels: ask the player “easy or hard?” at the start and use that answer in a condition to change which questions or thresholds apply. That means a conditional whose result depends on earlier input — a genuine step up.
Or: take one of your questions and rewrite its logic in AP Pseudocode by hand, correctly. Good practice for the exam’s pseudocode traces.