exam questions

Exam PCPP-32-101 All Questions

View all questions & answers for the PCPP-32-101 exam

Exam PCPP-32-101 topic 1 question 11 discussion

Actual exam question from Python Institute's PCPP-32-101
Question #: 11
Topic #: 1
[All PCPP-32-101 Questions]

Select the true statement about the __name__ attribute.

  • A. __name__ is a special attribute, which is inherent for both classes and instances, and it contains information about the class to which a class instance belongs.
  • B. __name__ is a special attribute, which is inherent for both classes and instances, and it contains a dictionary of object attributes.
  • C. __name__ is a special attribute, which is inherent for classes, and it contains information about the class to which a class instance belongs.
  • D. __name__ is a special attribute, which is inherent for classes, and it contains the name of a class.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Stokvisss
1 month, 1 week ago
Selected Answer: D
D is correct. ``` class t(): pass x1 = t() print(t.__name__) print(x1.__name__) ``` The above fails upon printing __name__ for x1.
upvoted 1 times
...
2211094
4 months, 2 weeks ago
D is valid answer
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago