What will be the output of the following Python code? [code] class A: def one(self): return self.two() def two(self):

Mỹ Duyên

New member
What will be the output of the following Python code?
Code:
class A:
    def one(self):
        return self.two()    	
    def two(self):
        return 'A'   
class B(A):
    def two(self):
        return 'B'
obj2=B()
print(obj2.two())
A. A
B. An exception is thrown
C. A B
D. B
 

Tìm kiếm

Back
Top