What is the most basic definition of \"iterable\", \"iterator\" and \"iteration\" in Python?
I have read multiple definitions but I am unable to identify the exact m
In Python everything is an object. When an object is said to be iterable, it means that you can step through (i.e. iterate) the object as a collection.
Arrays for example are iterable. You can step through them with a for loop, and go from index 0 to index n, n being the length of the array object minus 1.
Dictionaries (pairs of key/value, also called associative arrays) are also iterable. You can step through their keys.
Obviously the objects which are not collections are not iterable. A bool object for example only have one value, True or False. It is not iterable (it wouldn't make sense that it's an iterable object).
Read more. http://www.lepus.org.uk/ref/companion/Iterator.xml