Functions that keep to themselvesbeginner
A pure function gives the same answer for the same input and changes nothing outside itself — which is why you can call it from anywhere without reading it first.
A discount that works once. Run it twice and the basket is wrong.
The caller’s basket is untouched, and calling twice gives the same answer.
Published in full, before you start — every point is one of these and there is nothing else. Each one runs your code; it is not a search for keywords.
A pure function gives the same answer for the same input and changes nothing outside itself — which is why you can call it from anywhere without reading it first.