Python Programming - Objects - Discussion

Discussion Forum : Objects - General Questions (Q.No. 19)
19.
In Python, what is the purpose of the __eq__ method in a class?
To check if two objects are equal
To create a new instance of the class
To define class attributes
To delete a specific attribute
Answer: Option
Explanation:
The __eq__ method is used to define the equality comparison between two objects when the == operator is used.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.