
Python InstitutePCPP1 - Certified Professional Python Programmer 1
Domain 1Objective 7
PCPP-32-101 1.7 Understand Attribute Encapsulation PCPP-32-1 Practice Questions (Page 1)
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 17 practice questions to prepare you well beyond it. (estimate)
17questions here
4free pages
7concepts
35%of the exam
Questions 1–5
- 1
A `Document` class has a `_content` attribute. The developer needs to provide a way to read the content, replace it with new content (after checking that the new content is not empty), and clear it entirely. Which set of methods should be implemented?
Select an answer first - 2
A developer is maintaining a `Person` class with a `_age` attribute. The class is used in multiple parts of the codebase, and some legacy code directly accesses `person._age`. The developer wants to add validation (age must be between 0 and 150) without breaking the legacy code. What is the best approach?
Select an answer first - 3
A developer is explaining encapsulation to a junior colleague. The colleague asks why the `_balance` attribute in a `BankAccount` class should not be accessed directly as `account._balance`. What is the most accurate reason?
Select an answer first - 4
A developer is designing a `BankAccount` class with a `_balance` attribute. The requirements are: (1) balance can be read at any time, (2) deposits must add a positive amount, (3) withdrawals must not make the balance negative, and (4) the account can be closed, which resets the balance to zero. The developer wants to use a single setter method for both deposits and withdrawals. What is the best design?
Select an answer first - 5
A library management system has a `Book` class with a `_available` boolean attribute. The developer wants to ensure that the availability status can only be changed through a method that also updates the last-modified timestamp. What does this design primarily achieve?
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.