
GIAC Python Coder
Domain 1Objective 5
Exception Handling GPYC Practice Questions (Page 4)
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 16–20
- 16
Which except clause will catch a KeyError when accessing a dictionary with a missing key?
Select an answer first - 17
A junior developer wrote the following code to handle errors in a data-processing function: try: process(data) except: pass A senior developer reviews this and asks for a change. Which change best aligns with Python exception-handling best practices?
Select an answer first - 18
A Python script opens a database connection, runs a query, and must always close the connection, even if the query raises an exception. The script should also record a success message only when the query completes without error. Which code structure satisfies both requirements?
Select an answer first - 19
What is the purpose of using the raise statement without any arguments inside an except block?
Select an answer first - 20
How do you create 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 GIAC (SANS). “GPYC” is a trademark of its owner, used for identification only.