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 namespace in python?
Should I learn python or scala?
How will you verify different flags at once?
What is a raw input?
Where is freeze for windows?
Can we override a constructor?
Why should we hire you examples?
When does dictionary is used instead of a list in python?
What are classes in python?
how do I pass a variable by reference?
Explain me what is a built-in function that python uses to iterate over a number sequence?
What will be the output of the code:def foo (i=[])?
What are the built-in types available in python?
Is python duck typed?
List some pdb commands.