What will be the output of the following Python code? [code] class A: def __init__(self): self.multiply(15) print(self.i)

Huỳnh Hiền

New member
What will be the output of the following Python code?
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
 

Tìm kiếm

Back
Top