Activity 01
Pair Programming: Argument Order Challenge
Pairs define a function with three positional parameters, like calculate_area(length, width, unit). They write calls using positional order, then swap to cause errors and fix with keywords. Discuss readability differences.
Compare the use of positional arguments versus keyword arguments in function calls.
Facilitation TipDuring Pair Programming, circulate and listen for students explaining argument order explicitly so they verbalise the sequence rules.
What to look forPresent students with the following Python function definition: `def configure_printer(model, ink_level, duplex=True): pass`. Ask them to write two different function calls: one using only positional arguments, and another using a mix of positional and keyword arguments. Then, ask them to predict the output if `ink_level` is not provided.