Skip to content
Computer Science · Grade 10

Active learning ideas

Parameters and Return Values

Active learning works for parameters and return values because students must physically pass data into functions and handle outputs to see why modular design matters. When learners test functions in real code, they immediately grasp the difference between arguments and parameters, and why returns promote reusability over printing.

Ontario Curriculum ExpectationsCS.HS.P.3CS.HS.P.4
20–35 minPairs → Whole Class4 activities

Activity 01

Problem-Based Learning25 min · Pairs

Pair Programming: Parameter Practice

Pairs define three functions: one taking two numbers as parameters to return their product, one processing a list to return its sum, and one calculating average from multiple args. They write test calls with varied arguments and check outputs. Extend by chaining functions.

Differentiate between arguments and parameters in function calls.

Facilitation TipDuring Pair Programming: Parameter Practice, circulate and ask each pair to verbalize how the argument values map to the parameter names before running the code.

What to look forPresent students with a simple Python function definition and a function call. Ask them to identify the parameters in the definition and the arguments in the call. Then, ask them to predict the output if the function has a return statement.

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 02

Problem-Based Learning35 min · Small Groups

Small Groups: Function Chain Challenge

Groups receive starter code with global variables. They refactor into functions using parameters and returns, like a score processor that takes player data and returns rankings. Test chains where one function's output feeds another's input. Share successes.

Design functions that accept multiple inputs and return meaningful outputs.

Facilitation TipDuring Function Chain Challenge, provide scaffolded examples first, then step back to let groups discover how return values enable chaining.

What to look forProvide students with a scenario, such as calculating the area of a rectangle. Ask them to write a function that accepts length and width as parameters and returns the calculated area. They should also write the function call to find the area of a 5x10 rectangle.

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 03

Problem-Based Learning20 min · Whole Class

Whole Class: Trace and Debug Relay

Project code with functions on the board. Class traces step-by-step as teacher calls functions with arguments, revealing parameter binding and returns. Students predict outputs in chat, then debug errors collectively.

Evaluate the benefits of using return values over modifying global variables within functions.

Facilitation TipDuring Trace and Debug Relay, assign each student a small role in the trace so everyone contributes to the final output.

What to look forPose the question: 'When might it be better to have a function modify a global variable instead of returning a value?' Guide the discussion towards scenarios where side effects are intended or unavoidable, contrasting this with the benefits of pure functions for predictability.

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 04

Problem-Based Learning30 min · Individual

Individual: Refactor Assignment

Students get code relying on globals. Individually rewrite using parameters and returns, test with five cases, and document benefits. Submit for peer review next class.

Differentiate between arguments and parameters in function calls.

Facilitation TipDuring Refactor Assignment, require students to submit both the original and refactored versions to highlight the clarity gains from clean returns.

What to look forPresent students with a simple Python function definition and a function call. Ask them to identify the parameters in the definition and the arguments in the call. Then, ask them to predict the output if the function has a return statement.

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
Generate Complete Lesson

A few notes on teaching this unit

Start with concrete examples using familiar calculations, like distance between points, so students see parameters as inputs they control. Avoid abstract lectures on scope; instead, use live coding where you intentionally make mistakes with global variables and let students spot the risks. Research shows that students master returns faster when they experience the frustration of hard-to-debug globals in their own code.

By the end of these activities, students will confidently define functions with multiple parameters, call them with correct arguments, and use return values to chain operations without side effects. They will also debug functions by tracing parameter flow and justify when to return versus modify globals.


Watch Out for These Misconceptions

  • During Pair Programming: Parameter Practice, watch for students confusing arguments and parameters.

    Have pairs annotate their code with arrows from the call’s arguments to the definition’s parameters and label each side clearly before running the function.

  • During Function Chain Challenge, watch for students defaulting to printing results inside functions.

    Require groups to submit two versions of their code: one that prints inside the function and one that returns, then have them test how each integrates with the next function in the chain.

  • During Trace and Debug Relay, watch for students assuming return values automatically update global variables.

    In the relay, include a step where students must manually assign the return value to a variable and explain why globals are unnecessary in that scenario.


Methods used in this brief