What Will Be The Output Of The Following Python Codep Pre #1127
What will be the output of the following Python code?</p> <pre><code class="language-python"> class Demo: def __init__(self): self.x = 1 def change(self): self.x = 10 class Demo_derived(Demo): def change(self): self.x=self.x+1 return self.x def main(): obj = Demo_derived() print(obj.change()) main() </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.