
Python InstitutePCEP - Certified Entry-Level Python Programmer
Domain 4Objective 4
PCEP-30-02 4.4 Basics of Python Exception Handling PCEP-30 Practice Questions (Page 1)
Part of the Functions and Exceptions domain, which accounts for 28% of the PCEP-30 exam. Python Institute does not publish an official question count, but from its 45-minute exam (~20–30 total, ~6–8 in this domain), expect 2–2 from this objective — we provide 13 practice questions to prepare you well beyond it. (estimate)
13questions here
3free pages
5concepts
28%of the exam
Questions 1–5
- 1
A developer is writing a library function `read_config()` that may raise FileNotFoundError or PermissionError. The library should not handle these exceptions. What is the best approach?
Select an answer first - 2
A developer is writing a module that provides a `connect()` function. The module should not decide how connection errors are handled; the calling application should. What is the best approach?
Select an answer first - 3
A function `divide(a, b)` performs division. The caller wants to handle the case where the divisor is zero, but let other errors propagate. Which except clause should be used inside the function?
Select an answer first - 4
A function `validate()` raises a TypeError. It is called by `check()`, which does not catch it. `check()` is called from a script that has no try-except. What is the result?
Select an answer first - 5
A function `inner()` raises a ValueError. It is called by `outer()`, which does not catch it. `outer()` is called from the main script, which has a try-except block. Where is the exception handled?
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. “PCEP-30” is a trademark of its owner, used for identification only.