GIAC Python Coder

Here you have the best GIAC GPYC practice exam questions

  • You have 73 total questions across 15 pages (5 per page)
  • These questions were last updated on March 1, 2026
  • This site is not affiliated with or endorsed by GIAC.
Question 1 of 73

Which of the following will be the value of the variable y?
Exam GPYC: Question 1 - Image 1
Answer

Suggested Answer

The suggested answer is C.

The dictionary 'x' has two keys: 'a' and 'b'. The key 'b' is associated with the value which is a list: [[5, 6], 7]. Accessing x['b'][0] retrieves the first element of the list associated with 'b', which is [5, 6]. Then, accessing [5, 6][1] retrieves the second element of that list, which is 6. Therefore, the value of the variable y is 6.

Community Votes

No votes yet

Join the discussion to cast yours

Question 2 of 73

What are the contents of the variable x when the following is executed in a Python interactive session?
Exam GPYC: Question 2 - Image 1
Answer

Suggested Answer

The suggested answer is A.

When the expression x.split()[0][1] is evaluated, it first splits the string x into a list of words: ['So', 'you', 'want', 'a', 'GIAC', 'Certification?']. The expression then accesses the first word ('So') and retrieves the second character of that word ('o'). However, the value of x itself does not change due to this operation and remains as 'So you want a GIAC Certification?'. Given the requirement to print the value of x, the value is not altered and remains 'So'.

Community Votes

No votes yet

Join the discussion to cast yours

Question 3 of 73

Which of the following commands would correct the error in the screenshot?
Exam GPYC: Question 3 - Image 1
Answer

Suggested Answer

The suggested answer is A.

The error in the screenshot indicates that the name 'itertools' is not defined. This means that the itertools module has not been imported into the current namespace. To fix this, you need to import the itertools module at the beginning of your script using the command 'import itertools'. Therefore, option A is the correct choice.

Community Votes

No votes yet

Join the discussion to cast yours

Question 4 of 73

A user enters unexpected data into program. Which functionality can the programmer use to present an understandable error message to the user?
Answer

Suggested Answer

The suggested answer is B.

A programmer can use exception handling to present an understandable error message to the user when unexpected data is entered. Exception handling allows the programmer to detect errors during program execution and respond with appropriate and user-friendly error messages, improving the program's robustness and user experience.

Community Votes

No votes yet

Join the discussion to cast yours

Question 5 of 73

A programmer attempts to run the Python program hello.py as follows, but an error occurs. What is the cause of this error?
Exam GPYC: Question 5 - Image 1
Answer

Suggested Answer

The suggested answer is A.

The cause of the error is that the script hello.py is missing the line #!usr/bin/python. This line is called a shebang and it specifies the path to the interpreter that should be used to execute the script. Without it, the operating system does not know which interpreter to use and thus cannot execute the file directly.

Community Votes

No votes yet

Join the discussion to cast yours

About the GIAC GPYC Certification Exam

About the Exam

The GIAC GPYC (GIAC Python Coder) validates your knowledge and skills. Passing demonstrates proficiency and can boost your career prospects in the field.

How to Prepare

Work through all 73 practice questions across 15 pages. Focus on understanding the reasoning behind each answer rather than memorizing responses to be ready for any variation on the real exam.

Why Practice Exams?

Practice exams help you familiarize yourself with the question format, manage your time, and reduce anxiety on the test day. Our GPYC questions are regularly updated to reflect the latest exam objectives.