Home / MCQ Bank / Computer
Computer Concept Of Object Oriented Programs In Python

What will be the output of the following Python code? 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)

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option C • True

Related Computer Questions

Backward recovery is which of the following? The ______ function converts an uppercase letter to the corresponding lowercase letter. How many parameters are available in srand function? What is the correct syntax of constructing any using parameterized constructor? When the minimum number of instances of an entity is one, you know which of the following?