
Python InstitutePCAP - Certified Associate Python Programmer
Domain 4Objective 3
PCAP-31-03 4.3 Equip a Class with Methods PCAP-31 Practice Questions (Page 6)
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 26–30
- 26
A team is creating a `Logger` class to handle logging for a web application. They need to define a method `log_error` that takes a message string and writes it to a file. Which code snippet correctly declares this method inside the class?
Select an answer first - 27
A user has an instance `car` of class `Car`. The class has a method `start_engine` that takes no arguments besides `self`. Which of the following correctly calls this method on the instance?
Select an answer first - 28
In a `UserProfile` class, the `update_email` method needs to validate the new email and then update the instance's `email` attribute. The validation logic is in another method `validate_email`. Which code correctly uses `self` to call the validation method and update the attribute?
Select an answer first - 29
A developer is explaining to a junior colleague the difference between a method and a function in Python. Which statement accurately describes a key difference?
Select an answer first - 30
In a `TemperatureSensor` class, each sensor has a `reading` attribute. The `calibrate` method must adjust the reading by a given offset. Which implementation correctly modifies the instance's `reading`?
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.