What Will Be The Output Of The Following Python Codep Pre #1132
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.1.
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