What Will Be The Output Of The Following Python Codep Pre #1135
What will be the output of the following Python code?</p> <pre><code class="language-python"> class A: def __init__(self, x, y): self.x = x self.y = y def __str__(self): return 1 def __eq__(self, other): return self.x * self.y == other.x * other.y obj1 = A(5, 2) obj2 = A(2, 5) print(obj1 == obj2) </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs109 Python. It can also be found in gs gs109 Python OOPs - Python Polymorphism - Quiz No.2.