Dont understand Iterators Python
You apply __iter__() to an object that contains many values and it becomes an iterator. But in alot of guides, they say that containers such as list,tuples and dictionaries are iterable. Then why do I even need to make a list an iterator if it was iterable in the first place???????? My thoughts are that list,tuples and dictionaries are objects that contain many values and in a sequence. And thats it...contains many elements. Then I thought that the __iter__() when used on a list, makes that container an object that you CAN actually iterate through i.e perform a set of instructions on each element. Then using __next__(), you perform your set of instructions on an element within the container, depending on the sequence and retrieve just one result. Am I missing something that I need to learn before this or what??? P.s I have looked alot on this on places such as: https://stackoverflow.com/questions/25653996/what-is-the-difference-between-list-and-iterator-in-JUMP_LINK__&&__python__&&__JUMP_LINK https://www.geeksforgeeks.org/python-difference-iterable-iterator/ https://www.datacamp.com/community/tutorials/python-iterator-tutorial And of course Youtube.com If anyone can simplify what it is and why we need to make a list into an iterator to loop through, in like a really dumb way or an anology it would really help me alot.