1. Home
  2. Data Science
  3. Python
  4. What exception does next() raise when an iterator is…

Added 25 Nov 2026

What exception does next() raise when an iterator is exhausted in Python?

  1. IndexError
  2. EndError
  3. StopIteration Correct answer
  4. ValueError

Correct answer

C. StopIteration

6 views

MCQSEXAM

Explanation

StopIteration signals that no more items are available.

Reference

Asked in: Python Interview Advanced Python

https://docs.python.org/3/library/index.html

Preparing for an exam?

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs