Advertisements
Advertisements
प्रश्न
What is the use of the next() function?
लघु उत्तर
उत्तर
The next()
function in Python is used to retrieve the next item from an iterator. If the iterator is exhausted, it raises a StopIteration
exception. You can also provide a default value to be returned if the iterator is exhausted, preventing the exception.
Syntax:
next(iterator, default_value)
shaalaa.com
Creating a CSV File Using Notepad (or Any Text Editor)
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?