
Python InstitutePCAP - Certified Associate Python Programmer
Domain 4Objective 3
PCAP-31-03 4.3 Equip a Class with Methods PCAP-31 Practice Questions (Page 8)
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 36–40
- 36
A `Student` class has a method `set_grade(self, grade)` that sets `self.grade = grade`. After creating `student = Student()`, which call correctly sets the grade to 'A'?
Select an answer first - 37
In a `GameCharacter` class, the method `take_damage(self, amount)` needs to reduce the instance attribute `self.health` by `amount`. Which implementation is correct?
Select an answer first - 38
A `Document` class has a method `save(self)` that needs to call a validation method `_validate(self)` before saving. Which line inside `save` correctly calls `_validate`?
Select an answer first - 39
A developer is debugging a `BankAccount` class where the `deposit` method is defined as `def deposit(self, amount): balance += amount`. When they call `account.deposit(100)`, they get a `NameError`. What is the root cause?
Select an answer first - 40
A `ShoppingCart` class has a method `add_item(self, item)` that calls `self._update_total(item.price)`. The `_update_total` method is defined as `def _update_total(self, price): self.total += price`. However, when adding multiple items, the total is not accumulating correctly. What is the likely cause?
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.