Which methods a class must implement in Python to be considered an iterator. Select all that apply
Explanation
Any object that we want to be called an iterator must implement following 2 methods: __iter__ (is called on initialization of an iterator) and __next__ (should return the next value for the iterable)

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Cosmo
Sign Up Now
or Subscribe for future quizzes