Theory
Quick questions from every zone. Read the code, then pick.
๐PIT STOP 2 ยท LICENCE EXAM
Before the big races, every driver takes an exam. First quick questions, then real code.
HOW IT WORKS
Quick questions from every zone. Read the code, then pick.
Bigger challenges with real Python. Match the goal output.
No grades. Pick a face for each new zone.
THEORY
Questions mix every zone so far. A wrong answer becomes something to review.
total = 0
for n in [2, 3, 4]:
total = total + n
print(total)What will Python show?
speed = 25
if speed > 30:
print("fast")
elif speed > 20:
print("steady")
else:
print("slow")What will Python show?
print(8 > 3 and 2 > 5)What will Python show?
def double(n):
return n * 2
print(double(4))What will Python show?
Which line has the bug?
age = input("Age? ")
print(age + 1)TypeError: can only concatenate str (not "int") to str
Which first line squashes the bug?
import random
roll = random.randint(1, 6)Which number can it never be?
car = {"color": "red", "laps": 3}
print(car["laps"])What will Python show?
What does a programmer do first?
Which name is the clearest?
PRACTICAL
Take them in any order. Stuck? Open the zone under the challenge and come back.
Ask the driver's name, then let the function greet them.
Stuck? Review: input(): PyBot asks Boxes That Do a Job
Driver name? Mia Good luck, Mia!OUTPUT
Turn the answer into a number. Then loop once per lap.
Stuck? Review: input(): PyBot asks Repeat a Pattern
How many laps? 3 Vroom! Vroom! Vroom! Finish!OUTPUT
PyBot fixed the roll to 6 to test. Add the if and else.
Stuck? Review: random: dice and surprises Choose a Path
Roll: 6 Turbo boost!OUTPUT
PyBot split the pit stop into 3 steps. Make each step a function.
Stuck? Review: Think Like a Programmer Boxes That Do a Job
Tyres: new Fuel: full Go go go!OUTPUT
Give the boxes clear names. Then fix the loop so it adds every time.
Stuck? Review: Clean Code Repeat a Pattern
Total: 83OUTPUT
PyBot fixed the secret to 7 to test the game. Finish it.
Stuck? Review: input(): PyBot asks random: dice and surprises
Your guess? 7 You win!OUTPUT
Want a fresh start? Clear only this page.
HOW DID IT GO?
No grades here. For each zone, pick the face that fits you best.
You ask, decide, repeat, and plan with clean code. Next stop: your own game projects!