What Will Be The Output Of The Following Python Codep Pre #1099
What will be the output of the following Python code?</p> <pre><code class="language-python"> class A(): def disp(self): print("A disp()") class B(A): pass obj = B() obj.disp() </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 Inheritance - Quiz No.1.
What will be the output of the following Python code?
class A(): def disp(self): print("A disp()") class B(A): pass obj = B() obj.disp()
Invalid syntax for inheritance
Error because when object is created, argument must be passed
Nothing is printed
A disp()