Vidyalelo
Python · Q65

Concept of Object Oriented Programs in Python

Programming · Python · question 65

Q65

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

Answer: Option D

Solution

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