
Python InstitutePCAP - Certified Associate Python Programmer
Domain 4Objective 3
PCAP-31-03 4.3 Equip a Class with Methods PCAP-31 Practice Questions (Page 4)
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 16–20
- 16
A developer is reviewing code and sees a function defined inside a class. They need to explain to a colleague why this is considered a method. Which explanation is correct?
Select an answer first - 17
A `BankAccount` class has a `withdraw` method that must check if the balance is sufficient before deducting. The method also needs to call `log_transaction` to record the withdrawal. Which implementation correctly handles both the check and the logging, while ensuring the instance's balance is updated?
Select an answer first - 18
A `DataProcessor` class has a method `process` that must call `clean_data` and then `analyze_data`, both defined in the same class. The `clean_data` method modifies the instance's `data` attribute. Which code correctly chains these method calls using `self`?
Select an answer first - 19
A developer is debugging a `Rectangle` class where the `area` method returns `self.width * self.height`. However, when they call `rect.area()`, they get a `TypeError: area() takes 0 positional arguments but 1 was given`. What is the most likely cause?
Select an answer first - 20
A `ShoppingCart` class has a `remove_item` method that must decrease the `item_count` attribute and also call `recalculate_total` to update the total price. Which implementation correctly updates the instance state and calls the other method?
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.