Activity 01
Pair Programming: Star Pattern Challenge
Pairs write nested for loops to print patterns like a right-angled triangle of stars. First partner sketches the outer and inner loop logic on paper, then they code and test together, adjusting row and column counts. Swap roles for a hollow square pattern.
Justify the use of the 'else' block in a for loop.
Facilitation TipDuring Pair Programming: Star Pattern Challenge, remind students to print the pattern step-by-step on paper first before translating to code.
What to look forPresent students with a Python code snippet featuring a 'for...else' loop searching for a specific number in a list. Ask them to predict the output if the number is present and if it is absent, explaining the role of the 'else' block in each scenario.