What exception does next() raise when an iterator is exhausted in Python?
Correct answer
C. StopIteration
6 views
C. StopIteration
6 views
StopIteration signals that no more items are available.
Asked in: Python Interview Advanced Python
https://docs.python.org/3/library/index.htmlNot sure why the answer is C? Ask here and get an explanation.