Briefle words · Code & architecture
Pure function
A function whose result depends only on its inputs and that changes nothing outside itself.
Say it to an AI
Python pure function order_total(items, delivery_fee, promo=None) that returns the total in integer cents with a 5% service fee rounded to a whole cent. No side effects: don't mutate items or the order, no globals; handle the FREEDEL promo inside and keep it deterministic so it's trivially unit-testable.
How an expert would brief the stronger version of “Order total”.
See it
Try it as a puzzle →A food-delivery backend prices a customer's basket before showing the checkout screen.
Why: B takes 'items', 'delivery_fee' and 'promo' and just returns a total in whole cents; nothing else in the program is touched.
Related words
Room 3 · Functions & structure
Learn “Pure function” in a five-minute lesson