Smart-Check Routine
- Typical case — pick a simple input and trace the output.
- Empty input — does your loop handle
[]or""? - Single item — what if
n=1? - Boundary —
n=0, negative numbers, max values.
Common Bugs to Hunt
- Off-by-one in
range(). - Using
=instead of==. - Forgetting to initialise an accumulator.
- Indent drift — body that should be inside the loop but isn't.
Output Format Check
Re-read the question and compare your output character-by-character. Missing colons, spaces, or capitalisation routinely costs 1 mark each.
Practise this on PyForm — free
PyForm runs Python in your browser with an AI tutor trained for HKDSE. No install, no credit card.
Open PyForm →