Home / MCQ Bank / Computer
Computer Classes And Objects In Python

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()

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option B • __main__

Related Computer Questions

Which of the following type-casting have chances for wrap around? Which of the following sorting algorithm is not stable ______ What will be the output of the following Python code? x = [[0], [1]] print(len(' '.join(list(map(str, x))))) The first component can be accessed using ______ operator. What will be the output of the following C code? #include <stdio.h> struct student { char *name; }; struct student s[2]; void main() { s[0].name = "alan"; s[1] = s[0]; printf("%s%s", s[0].name, s[1].name); s[1].name = "turing"; printf("%s%s", s[0].name, s[1].name); }