What Will Be The Output Of The Following Python Codep Pre #1079
What will be the output of the following Python code?</p> <pre><code class="language-python"> class Demo: def __init__(self): pass def test(self): print(__name__) obj = Demo() obj.test() </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs109 Python. It can also be found in gs gs109 Classes and Objects - Python Classes and Objects - Quiz No.2.
What will be the output of the following Python code?
class Demo: def __init__(self): pass def test(self): print(__name__) obj = Demo() obj.test()
Exception is thrown
__main__
Demo
test