
Python InstitutePCPP1 - Certified Professional Python Programmer 1
Domain 1Objective 8
PCPP-32-101 1.8 Apply Subclassing of Built-In Classes PCPP-32-1 Practice Questions (Page 2)
Part of the Advanced Object-Oriented Programming domain, which accounts for 35% of the PCPP-32-1 exam. Python Institute does not publish an official question count, but from its 65-minute exam (~25–45 total, ~9–16 in this domain), expect 1–1 from this objective — we provide 21 practice questions to prepare you well beyond it. (estimate)
21questions here
5free pages
5concepts
35%of the exam
Questions 6–10
- 6
A developer creates a subclass of str that overrides __add__ to return a new instance of the subclass. They write: class UpperStr(str): def __add__(self, other): return UpperStr(super().__add__(other).upper()) They test 'a' + 'b' and it works. However, when they use the .join() method on a list of UpperStr objects, the result is a plain str, not an UpperStr. Why?
Select an answer first - 7
A team maintains a custom list subclass that logs every modification. They override append(), extend(), and insert() to call a logger before delegating to super(). A colleague notices that the log is incomplete when code uses the += operator. What is the reason?
Select an answer first - 8
Which of the following is a valid reason to create a subclass of a built-in class in Python?
Select an answer first - 9
A developer subclasses dict to add a timestamp attribute that records when the dictionary was created. They write: class TimedDict(dict): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.created_at = time.time() They create d = TimedDict({'a': 1}) and it works. However, when they copy the dictionary with d.copy(), the copy does not have the created_at attribute. Why?
Select an answer first - 10
What is the purpose of calling super() inside a method of a subclass of a built-in class?
Select an answer first
Finished these 5 questions?
Review the revealed explanations, or continue through the curriculum.
Free Basic Practice is a study aid with revealable answers — not a scored exam. Examers.io is independent and not affiliated with or endorsed by Python Institute. “PCPP-32-1” is a trademark of its owner, used for identification only.