Can you rewrite a school league’s scoring code without touching its results screen?
Your school league awards three points for a win and one point for a draw. The results screen already works. Could you rewrite the code that works out the points without changing the code that displays them?
A function can return a value for the caller to use. Remember that a local name such as total can only be used inside its function, and each call gets its own local variables. If the caller also has a variable named total, assigning to the local total leaves it unchanged.
Watch the numbers move. Input reads the wins and draws. The caller passes those counts to scoring, which returns the points total. The caller passes that total to display, which prints it. Splitting the program this way lets you tackle one job at a time.
The scoring module has already calculated the points. Think about the display module’s one job: printing the result. What should the caller pass to the display module? Pick one answer.
Document each module’s job, parameter order and types, and return value. Input reads the counts, takes no parameters and returns a tuple containing two integers, wins first. Scoring takes those integers in the same order and returns integer points. Display takes and prints the integer total. Python returns None because there’s no return statement.
Read results asks for two whole numbers and returns them as a pair. Score puts three times wins plus draws in its local variable total and returns it. Show result is our procedure: it prints points. The caller unpacks the pair, calls score, then passes the returned points to show result.
Keep the function header. In the body, add the wins count three times, then add the draws count and return the total. The caller stays the same. To test score on its own, pass four wins and two draws. Four plus four plus four plus two gives fourteen.
Try a second test without running the input or display modules. You pass two wins and five draws, in that order, to score. What integer should the function return? Pick the expected result.
Both inputs are integers, so Python can run the call even if you swap them. With four wins and two draws, passing draws first gives ten points. Passing wins first gives fourteen. The documented order matters even when the parameter types are identical.
If an AQA question asks you to explain the advantages of a documented interface, link each benefit to what it lets you do. You can test scoring without running input or display, replace its implementation without changing the caller, or reuse it in another competition that uses the same scoring rule.