1. Home
  2. Data Science
  3. Python
  4. Which special method makes an object usable in a for loop…

Added 25 Nov 2026

Which special method makes an object usable in a for loop in Python?

  1. __iter__ Correct answer
  2. __loop__
  3. __next_item__
  4. __each__

Correct answer

A. __iter__

MCQSEXAM

Explanation

__iter__ returns an iterator; it works with __next__.

Reference

Asked in: Python Interview OOP

https://docs.python.org/3/tutorial/classes.html

Preparing for an exam?

Doubts & discussion

Not sure why the answer is A? 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