[Tutor] 'for' loops

Kent Johnson kent37 at tds.net
Tue Dec 2 04:00:36 CET 2008


On Mon, Dec 1, 2008 at 7:56 PM, John Fouhy <john at fouhy.net> wrote:

> [1] Technically, it iterates over an iterator, which you can think of
> as an object that behaves like a list when you throw it at a for loop.

The object of the 'in' must be an iterable, which is an object that
can produce an iterator when asked. A list is an iterable, not an
iterator.

Kent


More information about the Tutor mailing list