Activity 01
Pair Programming: Math Function Builder
Pairs define three functions: one for addition (two params), one for area (length, width), and one for volume (length, width, height), each returning a value. They test by calling functions in a main script and print results. Pairs swap scripts to verify outputs match expected values.
Analyze how parameters enable functions to be more versatile and reusable.
Facilitation TipDuring the Pair Programming activity, circulate and ask one partner to explain the parameter’s role while the other traces the function’s execution step-by-step using print statements.
What to look forProvide students with a Python code snippet containing a function definition with parameters and a function call. Ask them to identify the parameters, the arguments passed, and the expected return value. For example: 'In the function `calculate_area(width, height)`, what are the parameters? If called as `calculate_area(5, 10)`, what are the arguments? What value will this function return?'