Certified Professional in Python Programming (PCPP-32-101) — Question 31

Select the true statement about the __name__ attribute.

Answer options

Correct answer: D

Explanation

The correct answer is D because the __name__ attribute is specifically tied to classes and indicates the name of the class itself. Options A and B incorrectly state that __name__ applies to instances, while C does not mention that __name__ provides the class name specifically.