Question: Add three methods to the Student class that compare two Student objects. One method ( _ _ eq _ _ ) should test for equality.

Add three methods to the Student class that compare two Student objects. One method (__eq__) should test for equality. A second method (__lt__) should test for less than. The third method (__ge__) should test for greater than or equal to. In each case, the method returns the result of the comparison of the two students names. Include a main function that tests all of the comparison operators.
Note: The program should output in the following format:
False: False True: True True: True False: False True: True True: True True: True True: True True: True True: True
(LO: 10.2)
Instructions
Task 1: Add a method to test for equality (__eq__).
Task 2: Add method to test for less than (__lt__).
Task 3: Add method to test for greater than or equal to (__ge__).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!