
GIAC Python Coder
Domain 1Objective 4
Functions, Classes and Objects GPYC Practice Questions (Page 5)
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 45 practice questions to prepare you well beyond it. (estimate)
45questions here
9free pages
14concepts
Questions 21–25
- 21
A developer is implementing a 'Temperature' class that stores a temperature in Celsius. They want to ensure that when the temperature is set, it is validated to be between -273.15 and 1000. Which approach correctly implements this validation?
Select an answer first - 22
A team is implementing a custom collection class. They want to support the 'in' operator to check if an item exists in the collection. Which special method should they implement?
Select an answer first - 23
What does the @property decorator do in a class?
Select an answer first - 24
A developer is working with a class that opens a file handle in __init__. They want to ensure the file is closed when the object is no longer needed. Which approach is the most reliable?
Select an answer first - 25
A developer is debugging a script that uses a nested function. The inner function needs to modify a variable from the outer function. Which keyword should they use?
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.