
Python InstitutePCAP - Certified Associate Python Programmer
Domain 2Objective 1
PCAP-31-03 2.1 Handle Errors Using Python-Defined Exceptions PCAP-31 Practice Questions (Page 4)
Part of the Exceptions domain, which accounts for 14% of the PCAP-31 exam. Python Institute does not publish an official question count, but from its 65-minute exam (~25–45 total, ~4–6 in this domain), expect 2–3 from this objective — we provide 23 practice questions to prepare you well beyond it. (estimate)
23questions here
5free pages
11concepts
14%of the exam
Questions 16–20
- 16
What does the 'from' clause do in 'raise ValueError('bad') from e'?
Select an answer first - 17
What is the purpose of the try block in a try/except statement?
Select an answer first - 18
Which statement correctly raises a ValueError with a custom message?
Select an answer first - 19
Which of the following is a direct subclass of Exception?
Select an answer first - 20
A team runs a Python script with the -O (optimize) flag in production. They use assert statements to validate internal invariants. A bug causes an invariant to fail in production. What happens?
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.