
Python InstitutePCEP - Certified Entry-Level Python Programmer
Domain 4Objective 3
PCEP-30-02 4.3 Python Built-In Exceptions Hierarchy PCEP-30 Practice Questions (Page 4)
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 35 practice questions to prepare you well beyond it. (estimate)
35questions here
7free pages
11concepts
28%of the exam
Questions 16–20
- 16
A developer is writing a function that accesses a list element by index and a dictionary value by key. The function should handle both an out-of-range index and a missing key with the same error-handling logic. Which except clause should be used?
Select an answer first - 17
A developer is writing a function that converts a user-provided string to an integer using `int()`. The function should catch the error that occurs when the string is not a valid number, such as `"abc"`. Which exception should be caught?
Select an answer first - 18
A developer is reviewing a colleague's code that contains the line `raise ArithmeticError("calculation failed")`. The developer knows that ArithmeticError is an abstract base class. What is the most accurate statement about this code?
Select an answer first - 19
Which built-in exceptions are NOT subclasses of the Exception class?
Select an answer first - 20
A developer is building a monitoring tool that must log every exception that occurs, including SystemExit and KeyboardInterrupt, but must then re-raise the exception so the program's normal termination behavior is preserved. Which except clause should be used?
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.