If you want to overload the less than (<) operator for a class, you will define the _______ method in your class.

  • __compare__
  • __less__
  • __lessthan__
  • __lt__
To overload the less than (<) operator for a class, you define the __lt__ (less than) method in your class. This method is called when the "<" operator is used with objects of the class.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *