Skip to content
Minute Campus.

Python in one minuteLesson 021 min

How does a for loop walk through a list?

A for loop takes one item from a list per turn, in order. On the first turn the loop name points to the first item and the indented line runs, then the loop moves to the next, and stops when none are left. The name is one you choose. Read it as a sentence: for each fruit in the list, print the fruit. Three items mean three runs.

Remember

The loop name holds one item per turn; the indented code runs once per item.

Sources

Checked at the source.

Every claim in the lesson was checked against these before it was recorded.

  1. 1More Control Flow Tools: for StatementsThe Python Tutorial · read 14 Nov 2026A for statement iterates over the items of a sequence in the order they appear.

Transcript

The lesson, word for word.

Read it at your own pace, or search the page for a term.

How does a for loop walk through a list? A list keeps its items in order. This one holds three fruits: apple, pear and plum. The loop takes one item per turn. The name fruit is one you choose, and Python does not mind what it is called. On the first turn, fruit points to apple, and the indented line prints it. The loop then moves on to pear, and then to plum. Read it as a sentence: for each fruit in the list, print the fruit. The indented line runs once for each fruit, so three fruits means three prints. When no items are left, the loop stops. Python's tutorial says a for statement iterates over the items of a sequence, in the order they appear. The rule: the loop name holds one item per turn, and the indented code runs once for each item.

Questions? Comment on the lesson on YouTube

New lessons every day.

Follow Minute Campus where you already scroll.