Week 3: For Loops, Lists, and Tuples
214 words
1 min read
Visual companion
Python
Type and operator map
Python Week 1: the first filter for runtime behavior
View
Revision summary
What this note is really saying
Short form
# Week 3: For Loops, Lists, and Tuples > **Course:** Jan 2026 - Python > **Focus:** Iteration over sequences, collection behavior, and nested repetition. --- ## 1.

Visual strip
Relevant recall pieces for this note
Week 3: For Loops, Lists, and Tuples
Course: Jan 2026 - Python Focus: Iteration over sequences, collection behavior, and nested repetition.
1. Core idea
Week 3 shifts from "repeat until done" to "repeat over a sequence."
What to remember
foriterates over items, not conditions.range(n)produces0ton - 1.- Lists are mutable.
- Tuples are immutable.
- Nested loops multiply work, so count them carefully.
2. Common traps
breakstops the loop immediately.continueskips the rest of the current turn.- A list slice returns a list.
- A tuple cannot be edited in place.
- Off-by-one errors often hide in
range(start, stop).
3. Speedrun pattern
When you see a Week 3 question, ask:
- Is this counting iterations or reading a collection?
- Does the code mutate the list?
- Is the question about the whole grid, or one cell at a time?
4. Micro revision
- Use
forfor fixed iteration. - Use
whilefor unknown iteration count. - Use lists for changeable collections.
- Use tuples for fixed collections and stable keys.
Assignment anchor
Navigation
- Previous: Week 2 Notes
- Next: Week 4 Notes