Refresh the brief and rules before you reopen PyCharm
Recap
What was this project?
Purpose
The purpose of the program is to help a visitor choose a leisure centre activity, check they are eligible, apply the correct discount and display a clear booking summary.
You built this entirely with techniques from SDD1–SDD8. No loops, arrays, lists or user-defined functions were needed — and today, none are used either.
If any of these feel rusty, that's exactly what today is for.
Recap
Activity and price rules
Activity
Standard price
Entry rule
Swimming
£8
Open to everyone
Climbing
£12
At least 10 years old AND at least 140 cm tall
Skating
£10
At least 8 years old
Climbing needs both conditions true (AND). Skating and swimming only ever check one thing.
Recap
Discount and booking code rules
Junior or senior discount Visitors aged 15 or under OR aged 65 or over receive £2 off.
Member discount Other eligible visitors who are members receive £1 off.
Booking code First three letters of the fictional name in uppercase, followed by the age. TestUser, age 14 → TES14.
Invalid choices An activity other than swimming, climbing or skating must produce a clear error message.
⚠️ Read the discount rules again carefully: a visitor only ever gets one discount, never both. The word "Other" in the member rule means it only applies when the junior/senior discount didn't already apply.
Worked Walkthrough
Trace it through — Test 1
Test data
Name TestUser · Age 14 · Height 145 cm · Member no · Activity climbing
Eligibility: climbing needs age ≥ 10 AND height ≥ 140. 14 ≥ 10 ✓ and 145 ≥ 140 ✓ → eligible.
Discount: age 14 ≤ 15 → the junior/senior discount applies (£2 off). Membership doesn't matter here — the age discount already applies.
Price: standard price £12, minus the £2 discount = £10.
Booking code: first three letters of "TestUser" in uppercase = TES, plus the age = TES14.
Your Turn
Predict it yourself
New test data — not one of your six
Name TestUser · Age 65 · Height 150 cm · Member yes · Activity climbing
Before you click reveal: is this visitor eligible? What price do they pay? What's their booking code? Work it out first.
Eligible: 65 ≥ 10 and 150 ≥ 140 ✓ Discount: age 65 ≥ 65 → junior/senior discount applies (£2 off) — the age discount wins even though they're a member Price: £12 − £2 = £10 Code:TES65
Common Mistakes
Syntax errors to check for
Mistake 1
Missing int()
✗ age = input("Age: ")
✓ age = int(input("Age: "))
Comparing a string to a number (e.g. age >= 10) crashes the program. Cast every number input.
Mistake 2
= instead of ==
✗ if activity = "swimming":
✓ if activity == "swimming":
Single = assigns a value. Double == compares. Python won't even run with a single = in an if.
Mistake 3
Capital AND / OR
✗ if age >= 10 AND height >= 140:
✓ if age >= 10 and height >= 140:
The brief writes AND/OR in capitals for readability — Python keywords must be lowercase.
Common Mistakes
Logic bugs to watch for
1️⃣ Stacking both discounts — applying the £1 member discount on top of the £2 age discount. The rules only ever give one discount per visitor.
2️⃣ Showing a price for an ineligible visitor — if the eligibility check fails, no price or booking code should be displayed at all.
3️⃣ Missing or misplaced invalid-activity check — any activity that isn't swimming, climbing or skating must trigger the clear error message, not a blank or incorrect result.
These won't crash your program the way syntax errors do — the program will run, but produce the wrong answer. This is why testing against the six expected results matters so much.
Before You Start
Your checklist
1Reopen leisure_centre.py in PyCharm.
2Run it for all six compulsory tests on the project page, using TestUser each time.
3Compare your actual results to the expected results table.
4Anything doesn't match? Check the syntax and logic mistake slides above before asking for help.
5Finished and all six pass? Try Extension 1 (Safer names) or Extension 2 (Weekend promotion) only.
Summary
What to remember
1
This project only ever needed selection — if / elif / else and complex conditions with and / or.
2
A visitor gets at most one discount — read "Other eligible visitors" carefully.
3
Testing against known expected results is how you catch logic bugs that don't crash the program.