New Year Special Sale - Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: mxmas70

Home > GIAC > Security Certification: GPYC > GPYC

GPYC GIAC Python Coder (GPYC) Question and Answers

Question # 4

Review the following code. Which of the following would give the results of variable "total"?

A.

addTogether()

B.

total()

C.

addTogether( 1,2,3)

D.

total (1,2,3)

Full Access
Question # 5

What is the output of the following program when executed with the Python Interpreter?

A.

SyntaxError: invalid syntax

B.

25

C.

20

D.

15

Full Access
Question # 6

Given that mylist = [1,3,2,1,4,5,3] how do you remove all occurrences of the number 1 from the list in Python?

A.

mylist=[x for x in mylist if x! = 1]

B.

mylist.remove(l, mylist.count(1))

C.

mylist.replace(1,"")

D.

mylist. remove(1)

Full Access
Question # 7

A log file is stored in variable "a". The file has the following format for each log entry, in order, stored in big endian:

Field 1: 2-byte integer

Field 2: 2-byte integer

Field 3: 4-byte string

Which of the following would unpack a line from the log file into the proper fields?

A.

struct. unpack('>HH4s',a)

B.

stmct.unpack('

C.

struct.unpack('>HHHH,/a)

D.

stnjct.unpack('!BxBx4s'/a)

Full Access
Question # 8

What is the output when the following commands are typed in Python interactive mode?

A.

15

B.

NameError: name 'c' is not defined

C.

ac

D.

TypeError: cannot concatenate 'str' and 'int' objects

Full Access
Question # 9

An attacker does not yet know the IP address of his target. He uses the "socket" module to create a backdoor program. He is writing the command to bind the computer's current IP address and port 4444 to the "backdoor" socket. Which command should he use?

A.

backdoor.bind(UDP, 4444)

B.

backdoor.bind()(4444)

C.

backdoor.bind((*))

D.

backdoor.bind(("",4444))

Full Access
Question # 10

Review the following code:

What is the output of this code?

A.

blue

B.

red blue

C.

red blue yellow

D.

red

Full Access
Question # 11

What does the "enumerate" function return when applied to a list?

A.

An object of tuples, with each assigned to an iterative integer

B.

The memory location of the list

C.

The total number of items in the list

D.

A list containing a single tuple, with the tuple containing all items in the original list

Full Access