About the Exam

GIAC Python Coder (GPYC) is a practitioner certification that validates a candidate's ability to write and analyze working code using Python. It is aimed at information security professionals, Python developers, forensic analysts, network defenders, and penetration testers. Passing demonstrates command of Python fundamentals and practical use of the language for data analysis, website and database interaction, network communication, packet analysis, and automation.

Exam Topics

  • Control Structures and Iteration0%
  • Creation of Executables0%
  • Data Analysis with Python0%
  • Data Structures0%
  • Database Interaction0%
  • Exception Handling0%
  • Functions, Classes and Objects0%
  • Network Interfaces0%
  • Packet Analysis with Python0%
  • Python Basics0%
  • Regular Expressions0%
  • Website Interaction0%

How to Use This Practice Exam

  1. Browse — Read each question, select your answer, and reveal the explanation.
  2. Exam Mode — Simulate real exam conditions with a timed session and score report.
  3. Learn Mode — Spaced repetition schedules questions you struggle with for long-term retention.

Download the Full Exam PDF

Get every question and answer in a clean, printable PDF built for offline study. Purchase once, keep permanent access, and re-download the latest version anytime.

Last updated April 4, 2025 at 9:34 PM

Topic filter
Retired questions
Question sort

QuestionQ1

Python Basics

Which of the following produces this list?

[65, 66, 67, 68]

  • A range(1,4) + 64
  • B for x(4)+64
  • C map(ord, ג€ABCDג€)
  • D range(4)+ 65
Explanation

Applying ord to each character in ABCD returns its numeric character code: A is 65, B is 66, C is 67, and D is 68. In Python 2, map(ord, 'ABCD') returns those values as a list.

Community Discussion

No comments yet. Be the first to start the discussion!

QuestionQ2

Python Basics

What output is produced by the following line of code entered in a Python interactive session?

>>> print (int(`1111`,2))  
  • A 1111
  • B 16
  • C ג€1111ג€
  • D 15
Explanation

In Python 2, backticks convert the integer 1111 to its string representation, '1111'. Converting that value with base 2 interprets it as the binary number 1111, whose decimal value is 15.

Community Discussion

No comments yet. Be the first to start the discussion!

QuestionQ3

Python Basics

Review this code:

Question Image

What output does it produce?

  • A (1, 0)
  • B (1,)
  • C (256,)
  • D (\x01, \x00)
Explanation

<H unpacks two bytes as a little-endian unsigned 16-bit integer. The bytes \x01\x00 therefore decode to 1, and struct.unpack returns its results in a one-element tuple.

Community Discussion

No comments yet. Be the first to start the discussion!

QuestionQ4

Regular Expressions

Which Python regular-expression method should you use to match any character in a-z, 0-9, or !@#$%^&amp;*()?

  • A \W
  • B Greedy matching
  • C A custom character set
  • D \w
Explanation

A custom character set explicitly matches the allowed letters, digits, and punctuation—for example, [a-z0-9!@#$%^&*()]. The \w shorthand excludes those punctuation characters, while \W matches non-word characters rather than the entire specified set.

Community Discussion

No comments yet. Be the first to start the discussion!

QuestionQ5

Control Structures and Iteration

How many lines does the following code print?

Question Image

  • A 0
  • B 1
  • C 99
  • D 199
  • E 2
Explanation

The loop increments x to 1 on its first iteration. Because 1 < 100, it executes one print statement and immediately exits the loop with break, so exactly one line is printed.

Community Discussion

No comments yet. Be the first to start the discussion!
Know a question that should be here? Contribute to this exam
Back home