A

Admin • 833K Points
Coach

Q. Which method is used to compare two Python objects?

  • (A) __str__
  • (B) __repr__
  • (C) __eq__
  • (D) __cmp__
  • Correct Answer - Option(C)
  • Views: 21
  • Filed under category Python
  • Hashtags:

Explanation by: Admin

The `__eq__` method is used to compare two objects for equality using `==`.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.