Python Programming - Inheritance - Discussion

Discussion Forum : Inheritance - General Questions (Q.No. 39)
39.
What is the purpose of the __next__() method in Python classes that implement iterators?
To define class attributes
To create a new instance of the class
To customize the next value when iterating over instances of the class
To access superclass attributes directly
Answer: Option
Explanation:
The __next__() method is used in classes that implement iterators to customize the next value when iterating over instances of the class.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.