
Python InstitutePCAP - Certified Associate Python Programmer
Domain 4Objective 3
PCAP-31-03 4.3 Equip a Class with Methods PCAP-31 Practice Questions (Page 9)
Part of the Object-Oriented Programming domain, which accounts for 34% of the PCAP-31 exam. Python Institute does not publish an official question count, but from its 65-minute exam (~25–45 total, ~9–15 in this domain), expect 2–3 from this objective — we provide 52 practice questions to prepare you well beyond it. (estimate)
52questions here
11free pages
6concepts
34%of the exam
Questions 41–45
- 41
A developer is refactoring a `Report` class. They want to replace a regular function `format_data(data)` with a method `format_data(self, data)` that also uses `self.header`. Which of the following is the primary benefit of making it a method?
Select an answer first - 42
A developer is working with a `Timer` class that has a method `start(self)` and a method `stop(self)`. They want to ensure that `stop` can be called only after `start` has been called. Which approach best enforces this constraint?
Select an answer first - 43
A developer is designing a `User` class with a method `update_profile(self, name, email)`. They want to reuse validation logic from a method `_validate_email(self, email)`. Which of the following statements are true about calling `_validate_email` from `update_profile`? Select all that apply.
Select an answer first - 44
In a `ShoppingCart` class, the method `add_item(self, item)` needs to call another method `_update_total(self, price)` to recalculate the total after adding an item. How should `add_item` invoke `_update_total`?
Select an answer first - 45
A developer is explaining to a colleague why a method must have `self` as its first parameter. Which of the following are valid reasons? Select all that apply.
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. “PCAP-31” is a trademark of its owner, used for identification only.