What Will Be The Output Of The Following Python Codep Pre #1134
What will be the output of the following Python code?</p> <pre><code class="language-python"> class Demo: def __check(self): return " Demo's check " def display(self): print(self.check()) class Demo_Derived(Demo): def __check(self): return " Derived's check " Demo().display() Demo_Derived().display() </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs109 Python. It can also be found in gs gs109 Python OOPs - Python Polymorphism - Quiz No.2.
What will be the output of the following Python code?
class Demo: def __check(self): return " Demo's check " def display(self): print(self.check()) class Demo_Derived(Demo): def __check(self): return " Derived's check " Demo().display() Demo_Derived().display()
Demo’s check Derived’s check
Demo’s check Demo’s check
Derived’s check Demo’s check
Syntax error