Vidyalelo
Python · Q81

Concept of Object Oriented Programs in Python

Programming · Python · question 81

Q81

What will be the output of the following Python code? class A: def __init__(self): self.__i = 1 self.j = 5 def display(self): print(self.__i, self.j) class B(A): def __init__(self): super().__init__() self.__i = 2 self.j = 7 c = B() c.display()

A.
2 7
B.
1 5
C.
1 7
Answer
D.
2 5

Answer: Option C

Solution

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