Answer Posted / nashiinformaticssolutions
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 is a class definition in python?
How python can be used in software testing?
How useful is python?
Is python slower than c?
How to generate random numbers in python?
What does the *args do in python?
How does xrange work in python?
How do you parse a json file in python?
What are the different environment variables identified by python?
How many rows can pandas handle?
Is python duck typed?
How do I share global variables across modules?
What is anonymous function or lambda function?
How to pass optional or keyword parameters from one function to another in python?
Is it easier than Django bottle?