Welcome to awslagi.com – Sharing AWS, Anthropic, Google Cloud, Microsoft Azure IT Exams. It's free for all!

GIAC Python Coder

Automate security tasks and build specialized tools using the power of Python programming.

4.8★★★★★(371 ratings)
21,955 studentsIntermediate
This certification validates your ability to use Python to solve security problems and automate repetitive tasks. You will learn to build custom scanners, automate incident response workflows, and develop tools to enhance your offensive or defensive capabilities. In modern security, the ability to code separates the pros from the crowd. GPYC status proves you can build the solutions you need, making you a highly efficient and valuable asset for advanced DevOps and security engineering teams.

What you'll learn

  • Python security scripts
  • Automating log analysis
  • Building custom security tools
  • Network and web automation with Python
  • Information gathering scripts

GPYC

Lectures1
Questions37
Duration30 week
Students21,955

$20.00

Full Free Question Bank (37 Questions)

GIAC Python Coder (GPYC) Practice Questions & Verified Answers

Click any option to test your knowledge, or reveal the verified answer and detailed explanation below each question.

Question #1Part 1Python Basics

Which of the following produces this list? [65, 66, 67, 68]

Arange(1,4) + 64
Bfor x(4)+64
Cmap(ord, ג€ABCDג€)
Drange(4)+ 65
Question #2Part 1Python Basics

What output is produced by the following line of code entered in a Python interactive session? >>> print (int(1111,2))

A1111
B16
Cג€1111ג€
D15
Question #3Part 1Python Basics

Review this code: What output does it produce?

A(1, 0)
B(1,)
C(256,)
D(\x01, \x00)
Question #4Part 1Regular Expressions

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

A\W
BGreedy matching
CA custom character set
D\w
Question #5Part 1Control Structures and Iteration

How many lines does the following code print?

A0
B1
C99
D199
E2
Question #6Part 1Exception Handling

What occurs when a programmer does not implement exception handling in a program and the program encounters an unforeseen error condition?

AThe interpreter will ignore the error and move to the next line.
BThe application will print a warning to the console and continue to the end
CThe computer will ג€fuzzג€ input until it finds one that generates no error
DThe application will terminate immediately or after resources are exhausted
Question #7Part 1Python Basics

What does the variablexcontain after the following commands run in a Python interactive session?

A'So'
B'So you'
C'So you want a GIAC Certification?'
D'So', 'you'
Question #8Part 1Database Interaction

In an SQLSELECTstatement, what does theLIMITfunction restrict?

AThe number of queries that can be run against the table per second.
BThe number of records a table is permitted to hold.
CThe number of records that will be returned by a request.
DThe number of subsequent SELECT statements that can be run against the table
Question #9Part 1Packet Analysis with Python

The variabletrafficholds a Scapy packet list. A programmer executes the following command: p1 = traffic[1] Which option describes the contents ofp1with respect to thetrafficpacket list?

AAll Ethernet layer frames
BThe contents of the second packet
CTCP streams with a session ID of 1
DThe data stored from the first byte onward
Question #10Part 1Control Structures and Iteration

Examine the code snippet below. What is the value of the variableiduring the loop's first iteration?

Ais
B1
C0
DPython
Question #11Part 1Packet Analysis with Python

A log file is held in variable a. Each log entry has the following big-endian format, in this order: - Field 1: 2-byte integer - - Field 2: 2-byte integer - - Field 3: 4-byte integer - Which of the following unpacks a line from the log file into the correct fields?

Astruct.unpack('>HH4s',a)
Bstruct.unpack('<HHssss',a)
Cstruct.unpack('>HHHH',a)
Dstruct.unpack('!BxBx4s',a)
Question #12Part 1Database Interaction

What action does an attacker take in a SQL injection attack?

AObtains an administrative login for a SQL database server
BFinds and exploits CVSS-SIG vulnerabilities in a particular version of SQL database
CInject information into an SQL server via an undocumented administrative interface
DSubmits a string that is interpreted as a SQL database command
Question #13Part 1Regular Expressions

What output results when the following commands are entered in Python interactive mode?

A['tag to go tag', 'to sans tag']
B['tag to go tag', 'tag to sans tag']
C['tag to go tag']
D['tag to go tag to sans tag']
Question #14Part 1Functions, Classes and Objects

When the followingquestion.pyprogram is run with Python, what is the output?

A10
B5
CFunctionOverride: function i assigned not called
D<function i at 0xb7489764>
Question #15Part 1Python Basics

What is the result of entering the following command in Python interactive mode? &gt;&gt;&gt; print(and in And now for something completely different)

ASyntaxError: invalid syntax
BTrue
CFalse
Question #16Part 1Python Basics

What is the output of this line of code entered in a Python interactive session? &gt;&gt;&gt; print(bin(0b101010 ^ 0b111000))

A0b10101
B18
C0b10010
D0b101101
Question #17Part 1Exception Handling

Review this Python 3 code. Which input causes the program output to includeThank You?

A539
B4a6e
C(52-4)
Dthree
Question #18Part 1Python Basics

What is the output of the following program when it is run with the Python interpreter?

ASyntaxError: invalid syntax
B25
C20
D15
Question #19Part 1Exception Handling

What is the output of the following commands entered in the Python Interactive shell?

ATry Else Except Finally
BTry Finally
CTry
DTry Else Finally
Question #20Part 1Control Structures and Iteration

What will the code in the screen capture output when it is executed?

A2
B4
Cx
DAn error
Question #21Part 1Python Basics

What is displayed when the following commands are entered in Python interactive mode?

A15
BNameError: name 'c' is not defined
Cac
DTypeError: cannot concatenate 'str' and 'int' objects
Question #22Part 1Exception Handling

A user provides unexpected data to a program. Which functionality can a programmer use to display an understandable error message to the user?

ACasting
BException handling
CDictionaries
DRegular expressions
Question #23Part 1Packet Analysis with Python

What does thels(TCP)function output?

AIt lists all of the TCP port numbers in a TCP stream
BIt lists all of the packets that have a TCP layer
CIt lists the contents of the TCP layer
DIt lists all of the fields associated with the TCP layer
Question #24Part 1Python Basics

Which of the following is the value of the variabley?

A7
By has no value. The following error occurred: IndexError: list index out of range
C6
Dy has no value. The following error occurred: KeyError: 'b'
Question #25Part 1Data Structures

Review the following code written in Python. What are the contents of variablea?

A'cat', 'dog', 'bird', 'violet'
B'dandelion', 'rose', 'cat', 'violet', 'bird', 'dog'
C'violet', 'rose', 'dandelion'
D'cat', 'dog', 'bird'
Question #26Part 1Creation of Executables

A programmer tries to execute the Python programhello.pyas shown, but an error results. What causes this error?

Ahello.py is missing the line #!usr/bin/python
Bsmtp_mime was replaced with Python
CPython cannot find the script ג€helloג€
Dhello.py is improperly encoded with UTF-16le
Question #27Part 1Python Basics

Which of the following commands would fix the error shown below?

Aimport itertools
Bmodulus itertools
Creturn itertools
Ddefine itertools
Question #28Part 1Network Interfaces

A connection is being established between a Python raw-socket server and a netcat client over port 1100 on the same computer. The final command in the Python terminal is: ``python &gt;&gt;&gt; connection,remoteip=pyserver.accept() ` The following 2 lines were entered in the netcat terminal: `text # nc 127.0.0.1 1100 This is a test `` What must be entered in the Python terminal to display the input from the netcat session? &gt;&gt;&gt; connection,remoteip=pyserver.accept() # nc 127.0.0.1 1100 This is a test

ANothing, as the connection is complete
Bconnection.recv(1024)
Cprint(remoteip)
DNothing, port 1100 is too low to bind the python server to
Question #29Part 1Python Basics

If the variableexampleholds a handle to a subprocess object, which of the following would display every possible result from running that subprocess?

Aexample.stdout.read()
Bexample.recv(*)
Cexample.read()
Dexample.stdout.read()+example.stderr.read()
Question #30Part 1Python Basics

What is the result of running the following Python code?

AThe path of each subkey under Microsoft\Windows NT\CurrentVersion
BA tuple containing the name, value, and type of each subkey under Microsoft\Windows NT\CurrentVersion
CThe full registry path of the CurrentVersion key
DA handle to the Microsoft\Windows NT\CurrentVersion
Question #31Part 1Website Interaction

Given a requests session object namedbrowser, how can you access the expiration attribute for a cookie namedMUIDfromgpyc.com/?

AB.
CD.
Question #32Part 1Creation of Executables

Which module lets a programmer define and launch new processes, connect to their input and output pipes, and obtain returned data?

Apip
Burllib2
Csubprocess
Dprochandle
Question #33Part 1Functions, Classes and Objects

Which lambda definition of the functionsome_codeis equivalent to the following function definition?

Asome_code = lambda outvalue:invalue*2
Bsome_code = lambda invalue:outvalue*2
Csome_code = lambda invalue:invalue*2
Question #34Part 1Exception Handling

After a subprocess is called in a Python program, the program receives an error code of0. What does this indicate?

AThe subprocess did not run
BThe subprocess terminated with no errors
CThe subprocess entered an infinite loop condition
DThe subprocess encountered a race condition
Question #35Part 1Regular Expressions

Which import statement below adds the capability to parse data using regular expressions in your script?

Afrom regex import re
Bimport re
Cfrom re import regex
Dimport regex
Question #36Part 1Website Interaction

Which command searches for Python modules that can parse pcap files?

Alocate(pcap)
Bpip search pcap
Cpip pcap
Dpfind(pcap)
Question #37Part 1Network Interfaces

When creating a new socket with Python’ssocketsmodule, which parameters specify that the socket will send and receive TCP traffic?

Asocket.SOCK_STREAM
Bsocket.AF_INET
Csocket.SOCK_DGRAM
Dsocket.socket

📢 Unlock Full Access to Success!

"The content displayed here is a promotional preview and contains only 50% of the actual exam database. To access the complete set of updated questions, please upgrade to the Full Version."

👉 Click the button and follow the instructions to secure your full access immediately!