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 are “special” methods in python?
Why is python 2 still used?
What is pycharm used for?
Why c++ is faster than python?
How will you convert a string to a set in python?
Write a program to reverse the string?
What packages in the standard library, useful for data science work, do you know?
What is python package manager (pypm)?
Is end a keyword in python?
Which methods of python are used to determine the type of instance and inheritance?
What is a constructor in python?
What is the python interactive console or python shell?
What sort does python use?
What does flush do in python?
Explain tkinter in python