Repetition is one of the core ideas in programming. Rather than writing the same calculation twenty times, you write it once inside a loop and let Python repeat it. The for loop is Python's tool for stepping through a sequence of items one at a time — characters in a string, measurements in a list, or numbers produced by the range() function. In engineering work, that sequence is often a set of sensor readings, a table of material properties, or a span of time steps in a simulation.
The range() function deserves special attention because it is how you turn a for loop into a counted loop. range(stop), range(start, stop), and range(start, stop, step) each generate a sequence of integers, and the fact that the stop value is excluded is a common source of off-by-one errors. When you need both the position and the value of each item — for example, to report that the third reading exceeded a limit — enumerate() gives you the index and the element together, which is cleaner and less error-prone than manually maintaining a counter variable.
As you watch these videos, trace the loop variable by hand: write down its value on each pass and note exactly when the loop stops. Pay attention to indentation, since the indented block is what repeats. Also notice how each presenter chooses between looping directly over a collection and looping over range() — knowing which to reach for is a skill you will use throughout this course.
A short, focused lesson on pairing for loops with range() to repeat a block of code a fixed number of times. Based on its description, it walks through tracing how the computer updates the loop variable on each iteration, which is the key mental model for understanding counted loops. Expect clear examples of the start, stop, and step behavior of range().
Khan Academy's Intro to CS material is carefully sequenced and accurate, and the emphasis on tracing loop variable updates directly supports the range() and numeric-range subtopics.
A beginner-oriented tutorial introducing the for loop as a basic control flow tool in Python, covering both how to write one and why you would use it. It is likely to demonstrate iterating over sequences such as lists and strings, along with the indentation rules that define the loop body. The pacing is brisk and example-driven.
It covers the foundational 'The for Loop' subtopic from the ground up, giving you the general iteration pattern before you specialize it with range().
A dedicated tutorial on Python's enumerate() function, part of CodeWithHarry's day-by-day Python series. It should explain how enumerate() returns both an index and a value during iteration, how to unpack those two items in the for statement, and when this approach is preferable to tracking a counter yourself. The longer runtime allows for worked examples.
This is the only video here devoted to enumerate(), so it fills the 'Iterating with an Index' subtopic directly and shows the idiomatic Python alternative to index arithmetic.
Together these videos build the for-loop half of MO2: the Python Simplified tutorial establishes the basic for loop over a sequence, the Khan Academy lesson adds range() for controlling a fixed number of iterations over numeric ranges, and the CodeWithHarry video adds enumerate() for cases where you need the index as well as the value. These iteration patterns are also prerequisites for the list-processing work in MO3, since looping is how you read, transform, and summarize the ordered collections you will build later in the module.
These videos were chosen from YouTube on October 2, 2026. Each has captions; the player turns them on. Videos on YouTube can be changed or removed — if one no longer plays, tell your instructor. If a player does not appear, use its Watch on YouTube link.