Examers.io
ExamsOrganizationsHow it worksPricingHelp & FAQ
GIAC (SANS) logo

GIAC Python Coder

Domain 1Objective 5

Exception Handling GPYC Practice Questions (Page 2)

Part of the Python Fundamentals domain, which makes up ~43% of our current practice bank. GIAC (SANS) does not publish an official question count, but from its 120-minute exam (~50–80 total, ~22–34 in this domain), expect 4–7 from this objective — we provide 25 practice questions to prepare you well beyond it. (estimate)

25questions here
5free pages
12concepts

Questions 6–10

  1. 6expert · hard

    A team maintains a library that raises a custom exception, ConfigurationError, for various configuration problems. They now need to distinguish between a missing key and an invalid value. The library's public API already documents that ConfigurationError is a subclass of ValueError. What is the best way to add this distinction without breaking existing callers?

    Select an answer first
  2. 7application · medium

    A developer is building a library function that accepts a numeric value representing a percentage. The function should signal an error if the value is outside the range 0–100, and the caller should be able to catch that specific error without catching unrelated ValueError instances. What is the best way to implement this?

    Select an answer first
  3. 8foundation · easy

    What is the purpose of the 'from' keyword in exception chaining?

    Select an answer first
  4. 9application · medium

    A DevOps engineer is writing a Python script that reads a configuration file and parses its JSON content. The script should log a clear message if the file is missing, and a different message if the JSON is malformed. Which approach best meets this requirement?

    Select an answer first
  5. 10foundation · easy

    What is the advantage of catching multiple exception types in a single except clause?

    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 GIAC (SANS). “GPYC” is a trademark of its owner, used for identification only.