Briefle words · Code & architecture
Named constant
A fixed value stored under a descriptive name (often in UPPER_CASE) and defined once.
Say it to an AI
Python late_fee(balance, days_late) returning a Decimal: 5-day grace period, 1.5% of the balance, a $25 collections fee after 30 days, capped at $40. No magic numbers: put each policy value in a named constant at module level so there is a single source of truth.
How an expert would brief the stronger version of “Loan late fee”.
See it
Try it as a puzzle →The rule that charges a late fee on an overdue loan payment in a lending app.
Why: B defines GRACE_PERIOD_DAYS, LATE_FEE_RATE, COLLECTIONS_AFTER_DAYS, COLLECTIONS_FEE and MAX_LATE_FEE, so the logic reads 'if days_late <= GRACE_PERIOD_DAYS'.
Related words
Room 1 · Essentials
Learn “Named constant” in a five-minute lesson