

MCQOPTIONS
Saved Bookmarks
1. |
What is the output of the following piece of code? class Test: def __init__(self): self.x = 0 class Derived_Test(Test): def __init__(self): Test.__init__(self) self.y = 1 def main(): b = Derived_Test() print(b.x,b.y) main() |
A. | Error because class B inherits A but variable x isn’t inherited |
B. | 0 0 |
C. | 0 1 |
D. | Error, the syntax of the invoking method is wrong |
Answer» D. Error, the syntax of the invoking method is wrong | |