Vidyalelo
Python · Q68

Concept of Object Oriented Programs in Python

Programming · Python · question 68

Q68

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

A.
15
B.
30
Answer
C.
An exception is thrown
D.
60

Answer: Option B

Solution

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