The Python Papers

The Python Papers

Python 101 - The for Loop

Mike Driscoll's avatar
Mike Driscoll
Nov 17, 2025
∙ Paid

There are many times when you are writing code that you will need to process each object in a collection. In order to do that you will iterate over that collection, which means getting each object from that collection one at a time. Collections of objects include strings such as “Hello, world”, lists like [1, 2, 3], and even files. The process of iterat…

User's avatar

Continue reading this post for free, courtesy of Mike Driscoll.

Or purchase a paid subscription.
© 2026 Mike Driscoll · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture