The Four Rules

Names That Describe Intent

# Bad
d = 86400        # seconds in a day?
x = get(u)

# Good
SECONDS_PER_DAY = 86400
user = get_user_by_id(user_id)

Avoid Abbreviations

Loop Counters Are OK Short

i, j, k are fine for numeric loops. For list iteration, prefer for student in students.

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 โ†’