Python Programming - Classes - Discussion

Discussion Forum : Classes - General Questions (Q.No. 18)
18.
What is the purpose of the __eq__ method?
It is called when an object is equal to another object using the == operator.
It defines the equality check for class attributes.
It is used to compare the memory addresses of two objects.
It signifies the end of an object's lifecycle.
Answer: Option
Explanation:
The __eq__ method is called when an object is compared for equality using the == operator. It allows customizing the behavior of equality checks for objects.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.