Examers.io
ExamsOrganizationsHow it worksPricingHelp & FAQ
Python Institute logo

Python InstitutePCAP - Certified Associate Python Programmer

Domain 2Objective 2

PCAP-31-03 2.2 Extend the Exceptions Hierarchy with Self-Defined Exceptions PCAP-31 Practice Questions (Page 1)

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 12 practice questions to prepare you well beyond it. (estimate)

12questions here
3free pages
6concepts
14%of the exam

Questions 1–5

  1. 1foundation · easy

    What is the purpose of the 'from' clause in the statement 'raise CustomError from original_error'?

    Select an answer first
  2. 2foundation · easy

    What is the benefit of implementing a custom __init__ method in a custom exception class?

    Select an answer first
  3. 3foundation · easy

    What happens when the following code is executed? class NegativeValueError(Exception): pass raise NegativeValueError("Value cannot be negative")

    Select an answer first
  4. 4application · easy

    A developer has a hierarchy: class AppError(Exception), class ConfigError(AppError), class DatabaseError(AppError). A function raises ConfigError. Which except block will catch it specifically without catching DatabaseError?

    Select an answer first
  5. 5foundation · easy

    What is the primary purpose of defining a custom exception class in Python?

    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.