PCPP-32-101 · Question #11
Select the true statement about the __name__ attribute.
The correct answer is D. __name__ is a special attribute, which is inherent for classes, and it contains the name of a class. name is a special attribute, which is inherent for classes, and it contains the name of a class. The __name__ attribute is a special attribute of classes that contains the name of the class as a string. The __name__ attribute is a special attribute in Python that is available…
Question
Select the true statement about the name attribute.
Options
- Aname is a special attribute, which is inherent for both classes and instances, and it contains
- Bname is a special attribute, which is inherent for both classes and instances, and it contains
- Cname is a special attribute, which is inherent for classes, and it contains information about
- Dname is a special attribute, which is inherent for classes, and it contains the name of a class.
How the community answered
(28 responses)- B7% (2)
- C4% (1)
- D89% (25)
Explanation
name is a special attribute, which is inherent for classes, and it contains the name of a class. The name attribute is a special attribute of classes that contains the name of the class as a string. The name attribute is a special attribute in Python that is available for all classes, and it contains the name of the class as a string. The name attribute can be accessed from both the class and its instances using the dot notation.
Topics
Community Discussion
No community discussion yet for this question.