Search⌘ K
AI Features

Iterables

Explore how iterables and iterators work in Python, focusing on their methods and the iterator protocol. Understand the difference between iterables and iterators, and how they enable looping over data structures. This lesson builds foundational knowledge essential for mastering asynchronous programming with Async.io.

We'll cover the following...

Iterables

Iteration is defined as the repetition of a process or utterance.

Iterable

In Python an iterable is an object which can be looped over its member elements using a for loop. An iterable is capable of returning its members one by one. The most common type of iterables in Python are sequences which include lists, strings and tuples. They support efficient access via indexing. The __getitem()__ can be invoked to return a member at the specified index. They also return their lengths via the ...