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()
class Demo:
def __init__(self):
pass
def test(self):
print(__name__)
obj = Demo()
obj.test()
A. Exception is thrown
B. __main__
C. Demo
D. test
Answer: Option B
Join The Discussion