Activity 01
Pair Programming: Rectangle Area Function
Pairs write a function def rectangle_area(length, width): that returns length * width. They call it with user inputs and print results. Switch roles after 10 minutes to test and refine each other's code.
Explain how functions contribute to making code more readable and manageable.
Facilitation TipDuring Pair Programming, have students alternate roles every 5 minutes so both contribute to writing and debugging the rectangle area function.
What to look forProvide students with a simple Python code snippet that uses a function. Ask them to: 1. Identify the function definition. 2. Write down the function call. 3. State the output of the code, explaining what the return value is.