Vương Tuấn Khải
New member
What will be the output of the following Python code?
A. 1 1 1
B. 1 2 3
C. ‘1’ ‘1’ ‘1’
D. An exception is thrown
Code:
class A:
def __repr__(self):
return "1"
class B(A):
def __repr__(self):
return "2"
class C(B):
def __repr__(self):
return "3"
o1 = A()
o2 = B()
o3 = C()
print(obj1, obj2, obj3)
B. 1 2 3
C. ‘1’ ‘1’ ‘1’
D. An exception is thrown