1
votes
class not_eq :
    def __init__ (self, num):
        self. num = num
    def __op__ (self, a):
        if (type (a. num) != type (self. num)):
            return True
        if self. num != a. num:
            return True
        else:
            return False
obj1 = not_eq (int (input ("Enter number 1: ")))
obj2 = not_eq (int (input ("Enter number 2: ")))
print (obj1 != obj2)

Even if the same inputs are given, True is the output. Where am I going wrong?

What do you think the __op__ method does?jonrsharpe
Did you mean __eq__?Samwise
Did you mean: def __ne__ (self, a):?quamrana
@quamrana yes, I got it. Thank youJeevani Reddy