A
Q. What is output of the following code?
Code:
class A:
def __init__(self, x):
self.x = x
def __eq__(self, other):
return self.x == other.x
a = A(5)
b = A(5)
print(a == b)
def __init__(self, x):
self.x = x
def __eq__(self, other):
return self.x == other.x
a = A(5)
b = A(5)
print(a == b)
- Correct Answer - Option(A)
- Views: 5
- Filed under category Python
- Hashtags:
Discusssion
Login to discuss.