PFP191Xuất hiện trong 1 đề thi
What is output of the sample code? ```python class A: def __init__(self): self.calc(30) def calc(self, i): self.i = 2 * i class B(A): def __init__(self): super().__init__() print("i from B is", self.i) def calc(self, i): self.i = 3 * i b = B() ```
Các lựa chọn
AThe __init__ method of only class B gets invoked.
BThe __init__ method of class A gets invoked and it displays “i from B is 0”.
CThe __init__ method of class A gets invoked and it displays “i from B is 60”.
DThe __init__ method of class A gets invoked and it displays “i from B is 90”.