1.

What does print(Test.__name__) display (assuming Test is the name of the class)?(a) ()(b) Exception is thrown(c) Test(d) __main__I got this question in unit test.Asked question is from Classes and Objects topic in section Classes and Objects, Inheritance, Polymorphism, Encapsulation and Exception Handling of Python

Answer»

Right answer is (c) Test

Easy EXPLANATION - __name__ built-in CLASS attribute is USED to DISPLAY the class name.



Discussion

No Comment Found

Related InterviewSolutions