Confused with python lists: are they or are they not iterators? [duplicate]

They are iterable, but they are not iterators. They can be passed to iter() to get an iterator for them either implicitly (e.g. via for) or explicitly, but they are not iterators in and of themselves.

Leave a Comment