In this sense, all the numbers in the set that are not “greater than 3” (4,5) are “less than or equal to 3” (1,2,3). This is what it means by the opposite of greater than. It’s not quite “the opposite” is it…
Thank you for your answer. I think I followed your suggestion, but it still doesn’t work.
def __le__(self, other):
if type(self) != type(other):
return NotImplemented
return not self.norm() > other.norm()
The logic here ensures that self is not greater than other, meaning it is less than or equal to. However, I still feel there should logically be a <= operator. I’m stuck at this point.
Ok, I got it… The issue was with how I approached the logic. I realized I didn’t need to explicitly call methods on self and other because the logic of a previous method already handles that.