
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 2)
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 6–10
- 6
A developer is creating a utility function `safe_divide(a, b)` that should not handle exceptions itself. The caller wants to catch ZeroDivisionError. What should the function do?
Select an answer first - 7
A function may raise either a LookupError or a KeyError. The developer wants to handle KeyError specifically and LookupError generically. Which except clause order is correct?
Select an answer first - 8
A script performs several operations that may raise different exceptions. The developer wants to handle a ValueError with a specific message, but let all other exceptions propagate. Which except clause is appropriate?
Select an answer first - 9
A script converts a string to an integer and then divides by a user-provided number. The developer wants to handle both ValueError and ZeroDivisionError with different messages. Which except clause structure is correct?
Select an answer first - 10
A developer writes a try block that may raise an ArithmeticError or a ZeroDivisionError. They want to handle ZeroDivisionError with a specific message and ArithmeticError with a generic message. Which except clause order is correct?
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.