Examveda

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

D. 2 5

Answer: Option C


Join The Discussion

Related Questions on Concept of Object Oriented Programs in Python