Examveda

What will be the output of the following Python code?
class A:
    def __init__(self):
        self.multiply(15)
        print(self.i)
 
    def multiply(self, i):
        self.i = 4 * i;
class B(A):
    def __init__(self):
        super().__init__()
 
    def multiply(self, i):
        self.i = 2 * i;
obj = B()

A. 15

B. 60

C. An exception is thrown

D. 30

Answer: Option D


Join The Discussion

Related Questions on Concept of Object Oriented Programs in Python