Vidyalelo
Python · Q35

Concept of Object Oriented Programs in Python

Programming · Python · question 35

Q35

What will be the output of the following Python code? class A: def one(self): return self.two() def two(self): return 'A' class B(A): def two(self): return 'B' obj1=A() obj2=B() print(obj1.two(),obj2.two())

A.
A A
B.
A B
Answer
C.
B B
D.
An exception is thrown

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board