Which special method makes an object usable in a for loop in Python?
Correct answer
A. __iter__
A. __iter__
__iter__ returns an iterator; it works with __next__.
Asked in: Python Interview OOP
https://docs.python.org/3/tutorial/classes.htmlNot sure why the answer is A? Ask here and get an explanation.