Activity 01
Pair Programming: Sum and Count Loops
Pairs receive a list of numbers and a string; first, write a for loop to sum the numbers using an accumulator. Next, adapt it to count vowels in the string. Finally, test with print statements and swap codes to debug partner's version.
Explain the purpose of a 'for' loop in automating repetitive tasks.
Facilitation TipDuring Pair Programming: Sum and Count Loops, ask students to alternate the roles of 'driver' and 'navigator' every two iterations to keep both engaged and accountable for loop correctness.
What to look forPresent students with a short Python code snippet containing a 'for' loop and a list. Ask them to write down the exact output the code will produce. For example: `my_list = ['apple', 'banana', 'cherry']; for fruit in my_list: print(fruit.upper())`
RememberUnderstandApplyAnalyzeSelf-ManagementRelationship Skills
Generate Complete Lesson→· · ·
Activity 02
Small Groups: Pattern Generators
Groups use for loops with range() to generate number patterns like multiples or stars in rows. Start by planning on paper, code in shared editor, then present one pattern to class for verification.
Construct a 'for' loop to process each item in a given list.
Facilitation TipIn Small Groups: Pattern Generators, provide pre-written starter code with intentional errors so groups must debug collaboratively before they can generate patterns.
What to look forProvide students with a scenario, such as 'Calculate the sum of all even numbers from 1 to 20'. Ask them to write a 'for' loop in Python that solves this problem and briefly explain why a 'for' loop is suitable here.
RememberUnderstandApplyAnalyzeSelf-ManagementRelationship Skills
Generate Complete Lesson→· · ·
Activity 03
Whole Class: Efficiency Race
Display a task like printing list items; students first write manual code individually, then rewrite with for loop. Time both approaches class-wide and discuss output matches and code length.
Compare the efficiency of using a 'for' loop versus manual repetition.
Facilitation TipDuring the Efficiency Race, time each group’s manual repetition versus loop solution to make the time savings visually concrete and memorable.
What to look forPose the question: 'Imagine you need to print the first 100 positive integers. How would you do this without a 'for' loop? Now, how would you do it with a 'for' loop? Discuss the advantages of the 'for' loop approach in terms of readability and effort.'
RememberUnderstandApplyAnalyzeSelf-ManagementRelationship Skills
Generate Complete Lesson→· · ·
Activity 04
Individual: Loop Modifications
Provide starter code with a basic for loop over a list. Students modify it three ways: reverse order, filter evens, add indices. Run and note changes in output.
Explain the purpose of a 'for' loop in automating repetitive tasks.
Facilitation TipFor Individual: Loop Modifications, circulate and listen for students explaining their changes aloud, as verbalizing logic reveals misunderstandings before coding continues.
What to look forPresent students with a short Python code snippet containing a 'for' loop and a list. Ask them to write down the exact output the code will produce. For example: `my_list = ['apple', 'banana', 'cherry']; for fruit in my_list: print(fruit.upper())`
RememberUnderstandApplyAnalyzeSelf-ManagementRelationship Skills
Generate Complete Lesson→A few notes on teaching this unit
Start by modeling how to trace a 'for' loop on the board, numbering each iteration and updating variable states beside it. Avoid rushing to abstract explanations; anchor every concept to a visible sequence like letters or numbers. Research shows students grasp loop purpose faster when they first see the loop body execute for each item, so prioritize live coding with immediate output checks over slides.
Successful learning looks like students confidently constructing 'for' loops that correctly process each element, explaining why the loop ends, and comparing its efficiency to manual repetition. They should also articulate when to use unpacking versus range(), and trace variable states accurately after the loop.
Watch Out for These Misconceptions
During Pair Programming: Sum and Count Loops, watch for students assuming loops run forever like while loops. Redirect them by having the pair add print statements inside the loop to show each iteration and confirm the loop ends after the last item.
During Pair Programming: Sum and Count Loops, have each pair trace their loop on paper, numbering iterations and recording the loop variable’s value after each step to prove the loop is finite and predictable.
During Small Groups: Pattern Generators, watch for students reusing the loop variable after the loop ends, assuming it still holds its value. Redirect them by asking the group to print the variable immediately after the loop and observe that it now contains the last item only.
During Small Groups: Pattern Generators, require groups to insert a print statement right after the loop to verify the loop variable’s final value, reinforcing that the variable’s scope ends when the loop does.
During the Efficiency Race, watch for students insisting for loops only work with numbers. Redirect them by timing how long it takes to manually repeat a string operation versus coding a loop that processes each character.
During the Efficiency Race, provide mixed data (strings, lists of mixed types) and time both manual repetition and loop solutions to demonstrate for loops iterate any sequence, not just numbers.
Methods used in this brief