โ†Previous page

๐ŸPIT STOP 2 ยท LICENCE EXAM

Time for your driving licence!

Before the big races, every driver takes an exam. First quick questions, then real code.

HOW IT WORKS

Two parts, then your stamp.

Theory

Quick questions from every zone. Read the code, then pick.

Practical

Bigger challenges with real Python. Match the goal output.

Tell PyBot how it went

No grades. Pick a face for each new zone.

THEORY

Answer like a driver.

Questions mix every zone so far. A wrong answer becomes something to review.

0Completed
16Not tried
0Review
01

Loop and box

total = 0 for n in [2, 3, 4]: total = total + n print(total)

What will Python show?

02

Pick one path

speed = 25 if speed > 30: print("fast") elif speed > 20: print("steady") else: print("slow")

What will Python show?

03

True or False?

print(8 > 3 and 2 > 5)

What will Python show?

04

A box that returns

def double(n): return n * 2 print(double(4))

What will Python show?

05

Tap the buggy line

Python says: SyntaxError on line 2.

Which line has the bug?

06

Answers are text

age = input("Age? ") print(age + 1)
TypeError: can only concatenate str (not "int") to str

Which first line squashes the bug?

07

Roll the dice

import random roll = random.randint(1, 6)

Which number can it never be?

08

A labeled box

car = {"color": "red", "laps": 3} print(car["laps"])

What will Python show?

09

A big job

PyBot wants to build a quiz game. It feels too big!

What does a programmer do first?

10

The clearest name

A box keeps how many lives the player has left.

Which name is the clearest?

PRACTICAL

Now drive real code.

Take them in any order. Stuck? Open the zone under the challenge and come back.

01

Greet the driver

Ask the driver's name, then let the function greet them.

Stuck? Review: input(): PyBot asks Boxes That Do a Job

Goal output
Driver name? Mia
Good luck, Mia!
OUTPUT

02

How many laps?

Turn the answer into a number. Then loop once per lap.

Stuck? Review: input(): PyBot asks Repeat a Pattern

Goal output
How many laps? 3
Vroom!
Vroom!
Vroom!
Finish!
OUTPUT

03

Turbo dice

PyBot fixed the roll to 6 to test. Add the if and else.

Stuck? Review: random: dice and surprises Choose a Path

Goal output
Roll: 6
Turbo boost!
OUTPUT

04

The pit crew plan

PyBot split the pit stop into 3 steps. Make each step a function.

Stuck? Review: Think Like a Programmer Boxes That Do a Job

Goal output
Tyres: new
Fuel: full
Go go go!
OUTPUT

05

Clean the lap timer

Give the boxes clear names. Then fix the loop so it adds every time.

Stuck? Review: Clean Code Repeat a Pattern

Goal output
Total: 83
OUTPUT

06

Guess the secret number

PyBot fixed the secret to 7 to test the game. Finish it.

Stuck? Review: input(): PyBot asks random: dice and surprises

Goal output
Your guess? 7
You win!
OUTPUT

Your work is saved here.

Want a fresh start? Clear only this page.

HOW DID IT GO?

Tell PyBot the truth.

No grades here. For each zone, pick the face that fits you best.

PyBot's Superpowers
Think Like a Programmer
Clean Code
Boxes That Do a Job
BIG IDEA

Licence earned: you build real programs.

You ask, decide, repeat, and plan with clean code. Next stop: your own game projects!