The correct answer is that MyClass inherits from builtins.object. This is because in Python, every class implicitly inherits from object unless another base class is explicitly specified; when you write `class MyClass:` with no parentheses or parent class, Python automatically sets `object` as its superclass. This concept of implicit inheritance from object is fundamental to Python’s object model and is a common focus on the Certified Associate Python Programmer PCAP exam, often appearing in questions about class hierarchy or the `__bases__` attribute. A frequent trap is assuming a class with no declared parent has no inheritance at all, but in reality, it always inherits `object`’s methods like `__str__` and `__repr__`. Remember the mnemonic: “No parent? Object’s your default ancestor.”
PCAP Object-Oriented Programming Practice Question
This PCAP practice question tests your understanding of object-oriented programming. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
Exhibit
>>> help(MyClass)
Help on class MyClass in module __main__:
class MyClass(builtins.object)
| Methods defined here:
|
| __init__(self, value)
| Initialize self. See help(type(self)) for accurate signature.
|
| display(self)
| Print the value.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
Refer to the exhibit. Which of the following is true about MyClass?
>>> help(MyClass)
Help on class MyClass in module __main__:
class MyClass(builtins.object)
| Methods defined here:
|
| __init__(self, value)
| Initialize self. See help(type(self)) for accurate signature.
|
| display(self)
| Print the value.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
A
MyClass has an instance method called display.
Why wrong: While true, the question asks for one true statement; C is also true but more definitive.
B
MyClass has a class attribute called display.
Why wrong: display is a method, not a class attribute.
C
MyClass has both __init__ and display as class methods.
Why wrong: Both are instance methods, as they take self.
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
MyClass inherits from builtins.object.
In Python, every class implicitly inherits from `builtins.object` unless another base class is specified. Since the exhibit shows `class MyClass:` with no explicit parent, `MyClass` automatically inherits from `object`. This makes option D correct.
Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
✗
MyClass has an instance method called display.
Why it's wrong here
While true, the question asks for one true statement; C is also true but more definitive.
✗
MyClass has a class attribute called display.
Why it's wrong here
display is a method, not a class attribute.
✗
MyClass has both __init__ and display as class methods.
Why it's wrong here
Both are instance methods, as they take self.
✓
MyClass inherits from builtins.object.
Why this is correct
The help output confirms inheritance from object.
Related concept
Read the scenario before looking for a memorised answer.
Common exam traps
Common exam trap: answer the scenario, not the keyword
Python Institute often tests the distinction between static methods, class methods, instance methods, and class attributes, trapping candidates who confuse `@staticmethod` with instance methods or class attributes.
Detailed technical explanation
How to think about this question
Under the hood, Python's class creation mechanism calls the metaclass `type`, which automatically sets `__bases__` to `(object,)` when no parent is given. This ensures every class has default methods like `__new__` and `__repr__`. In real-world code, relying on implicit inheritance is common, but explicitly inheriting from `object` (new-style classes) was mandatory in Python 2 to get proper behavior like descriptors and `super()`.
KKey Concepts to Remember
Read the scenario before looking for a memorised answer.
Find the constraint that changes the correct option.
Eliminate answers that are true in general but not in this case.
TExam Day Tips
→Watch for words such as best, first, most likely and least administrative effort.
→Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Real-world example
How this comes up in practice
A media company stores terabytes of video archives that are accessed once a year for audit purposes. Moving these objects to a cold storage tier (Azure Archive, S3 Glacier, or Google Nearline) costs a fraction of hot storage. Questions like this test whether you understand storage tiers, access frequency tradeoffs, and retrieval latency requirements.
What to study next
Got this wrong? Here's your next step.
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
Object-Oriented Programming — This question tests Object-Oriented Programming — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: MyClass inherits from builtins.object. — In Python, every class implicitly inherits from `builtins.object` unless another base class is specified. Since the exhibit shows `class MyClass:` with no explicit parent, `MyClass` automatically inherits from `object`. This makes option D correct.
What should I do if I get this PCAP question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
What is the key concept behind this question?
Read the scenario before looking for a memorised answer.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
This PCAP practice question is part of Courseiva's free Python Institute certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCAP exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.