iterable in Python

iterable is Python jargon for any object whose elements can be iterated. Typically, the built-in iter() method is applied on an iterable object to obtain an iterator. This iterator can only be used to move forward through the items of the iterable object from the beginning to the end, only once.

iterable is not a keyword. However, you will see it mentioned as the input parameter name in lots of built-in functions. This is an indication to the user that the function expects an iterable object as input.

For more info, see Glossary.

About these ads