Iterable in python

In Python, an iterable is an object that can be used in a for loop to iterate over its elements. An iterable must implement the __iter__ method, which returns an iterator, or the __getitem__ method, which allows indexing of the object.

Some examples of iterable objects in Python are lists, tuples, strings, and dictionaries.

Last updated