Skip to content
Computing · Year 10

Active learning ideas

Parameters and Return Values

Active learning works for parameters and return values because students need to see memory concepts in action, not just hear about them. Hands-on tracing and debugging let students observe how data moves and changes, building durable mental models beyond abstract explanations.

National Curriculum Attainment TargetsGCSE: Computing - Programming Fundamentals
20–45 minPairs → Whole Class4 activities

Activity 01

Pair Programming: Value vs Reference Duel

Pairs write two versions of a function: one modifying an integer by value and one by reference using addresses or objects. Call each with test data, print variables before and after, then swap and explain results. Extend to lists for visual changes.

Explain the concept of passing parameters by value versus by reference.

Facilitation TipIn Value vs Reference Duel, insist each pair prints both the memory address and the value before and after the call to make the abstraction concrete.

What to look forPresent students with two simple Python code snippets. Snippet A uses pass by value, Snippet B uses pass by reference. Ask students to predict the output of each snippet after a variable is modified within a function and explain the difference in their predictions.

ApplyAnalyzeEvaluateCreateRelationship SkillsDecision-MakingSelf-Management
Generate Complete Lesson

Activity 02

Collaborative Problem-Solving45 min · Small Groups

Small Group Challenge: Multi-Param Calculator

Groups design functions taking two numbers and an operator as parameters, compute results, and return the value. Integrate into a main program for a menu-driven calculator. Test edge cases like division by zero collaboratively.

Analyze how return values enable functions to contribute to larger computations.

Facilitation TipFor the Multi-Param Calculator, provide a starter sheet with partially written tests so groups focus on function logic rather than syntax scaffolding.

What to look forProvide students with a scenario: 'Write a function called 'calculate_area' that takes 'length' and 'width' as parameters and returns the calculated area. Then, show how you would call this function and print its return value.'

ApplyAnalyzeEvaluateCreateRelationship SkillsDecision-MakingSelf-Management
Generate Complete Lesson

Activity 03

Collaborative Problem-Solving25 min · Whole Class

Whole Class Debug Relay: Parameter Pitfalls

Project buggy code on screen with mixed passing modes and return errors. Teams send one member at a time to fix one issue, relay back with explanation. Class votes on fixes and runs tests together.

Construct a function that takes multiple parameters and returns a calculated result.

Facilitation TipDuring Parameter Pitfalls, give each team only two minutes per relay station so they practice rapid diagnosis and concise explanations under time pressure.

What to look forAsk students: 'Imagine you are building a system to manage a library's book inventory. Describe a function you might create, what parameters it would need, and what value it might return. Explain why you chose pass by value or pass by reference for any relevant parameters.'

ApplyAnalyzeEvaluateCreateRelationship SkillsDecision-MakingSelf-Management
Generate Complete Lesson

Activity 04

Collaborative Problem-Solving20 min · Individual

Individual Extension: Custom Function Portfolio

Students independently create three functions with parameters and returns for a personal project, like a grade calculator. Document inputs, outputs, and passing modes with traces. Peer review follows.

Explain the concept of passing parameters by value versus by reference.

Facilitation TipIn the Custom Function Portfolio, require students to include at least one example using pass by reference and one using multiple parameters to demonstrate mastery.

What to look forPresent students with two simple Python code snippets. Snippet A uses pass by value, Snippet B uses pass by reference. Ask students to predict the output of each snippet after a variable is modified within a function and explain the difference in their predictions.

ApplyAnalyzeEvaluateCreateRelationship SkillsDecision-MakingSelf-Management
Generate Complete Lesson

A few notes on teaching this unit

Teach by making students confront the limits of their intuitions through guided tracing. Avoid long lectures on memory; instead, use live code projection where you step through calls and let students vote on outcomes. Research shows that concrete, observable differences—like address prints and value changes—build stronger understanding than abstract diagrams. Emphasize the difference between inputs (parameters) and outputs (returns) by isolating them in separate lines of code and naming conventions.

Successful learning looks like students correctly predicting subroutine behavior, distinguishing value and reference at a glance, and confidently integrating functions with multiple parameters into larger programs. By the end, they should explain their choices and debug related errors independently.


Watch Out for These Misconceptions

  • During Pair Programming: Value vs Reference Duel, watch for students assuming all parameters pass by value and therefore changes inside functions never affect caller variables.

    Have pairs add two print statements before and after the function call: one showing the memory address of the variable, the other showing its value. Ask them to compare addresses across calls to see when references are shared.

  • During Multi-Param Calculator, watch for students believing return values directly change the parameters passed in.

    Require students to write a short test case where they call the function, store the return value in a new variable, and then inspect both the parameter and the return variable separately to confirm no mutation occurred.

  • During Custom Function Portfolio, watch for students asserting that functions cannot produce multiple outputs beyond a single return value.

    Ask students to use the portfolio template to include a function that uses a reference parameter to return a second computed value, then document why this approach works and how it differs from returning multiple values directly.


Methods used in this brief