Answer Posted / hr@tgksolutions.com
An object that lets you go through a collection's items (such lists, tuples, or dictionaries) one at a time is called an iterator in Python. An iterator implements two methods: __next__(), which returns the subsequent item in the sequence and raises StopIteration when the sequence is exhausted, and __iter__(), which returns the iterator object itself.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What does none type mean in python?
What is sphinx in python?
Is python a programming?
Is python an oop?
What does file flush mean?
What are the different ways to create an empty numpy array in python?
Why is python oop?
Will python work multiple inheritance?
What animals sleep the least?
Is python interpreted, or compiled, or both?
What’s the difference between a for loop and a while loop?
How many modes are there in python?
What is a variable in python?
How do you write a function in python 3?
Are there pointers in python?