
GIAC Python Coder
Domain 1Objective 2
Data Structures GPYC Practice Questions (Page 1)
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 37 practice questions to prepare you well beyond it. (estimate)
37questions here
8free pages
12concepts
Questions 1–5
- 1
What does the following list comprehension produce? ```python [x**2 for x in range(5)] ```
Select an answer first - 2
A data analyst has a nested dictionary: data = {'server': {'cpu': 4, 'ram': 8}}. The analyst needs to safely access the 'ram' value, returning 0 if the 'server' key or 'ram' key does not exist. Which expression accomplishes this?
Select an answer first - 3
What is the result of {1, 2, 3} & {2, 3, 4}?
Select an answer first - 4
A security analyst maintains a dictionary mapping hostnames to lists of open ports. A new scan reveals that host 'web01' has port 8443 open in addition to its existing ports. The analyst needs to update the dictionary in place, preserving the existing port list for that host. Which code snippet correctly accomplishes this?
Select an answer first - 5
How do you access the value 'x' in the following nested dictionary? ```python data = {'a': {'b': {'c': 'x'}}} ```
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.