nerdexam
Python_Institute

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…

Advanced OOP

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)
  • B
    7% (2)
  • C
    4% (1)
  • D
    89% (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

#__name__ attribute#class attributes#special attributes

Community Discussion

No community discussion yet for this question.

Full PCPP-32-101 Practice