Summer Special Sale - Limited Time 60% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 575363r9

Welcome To DumpsPedia

GPYC Sample Questions Answers

Questions 4

What does executing the following code in Python 3 result in?

'\x0066'

Options:

A.

f

B.

102

C.

\x0066

D.

01100110

Buy Now
Questions 5

In a SQL injection attack, which character would an attacker use to separate multiple SQL statements on a single line?

Options:

A.

''(double quotation marks)

B.

; (semicolon)

C.

. (period)

D.

% (percentage sign)

Buy Now
Questions 6

When creating a new socket using the Python "sockets" module, which of the following parameters is used to specify the socket will send and receive TCP traffic? Choose Two

Options:

A.

socket.SOCK_STREAM

B.

socket. AF_NET

C.

socket.SOCK_DGRAM

D.

socket.socket

Buy Now
Questions 7

What is the output of the following line of code typed into a Python interactive session?

>>>print (8 <<1)

Options:

A.

False

B.

16

C.

SyntaxError: invalid syntax

D.

True

Buy Now
Questions 8

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?

Options:

A.

struct. unpack('>HH4s',a)

B.

stmct.unpack('

C.

struct.unpack('>HHHH,/a)

D.

stnjct.unpack('!BxBx4s'/a)

Buy Now
Questions 9

Review the following code:

What is the output of this code?

Options:

A.

blue

B.

red blue

C.

red blue yellow

D.

red

Buy Now
Questions 10

A programmer attempts to run the Python program hello.py as follows, but an error occurs. What is the cause of this error?

Options:

A.

hello.py is missing the line #!/usr/bin/python

B.

smtp_mime was replaced with Python

C.

Python cannot find the script "hello"

D.

hello.py is improperly encoded with UTF-16le

Buy Now
Questions 11

How many bytes are used to store a 16 bit Unicode character?

Options:

A.

3

B.

4

C.

2

D.

1

Buy Now
Questions 12

Review the following code.

What is the output?

Options:

A.

(1,0)

B.

(1,)

C.

(256,)

D.

(\x01#\x00)

Buy Now
Questions 13

What is the output of the following command typed in Python interactive mode?

Options:

A.

SyntaxError: invalid syntax

B.

True

C.

False

Buy Now
Questions 14

What is the cause of the error shown below?

Options:

A.

A syntax error

B.

The re module hasn't been imported

C.

A bad file name

D.

The stdin module hasn't been imported

Buy Now
Questions 15

A connection between a python raw socket server and a netcat client is being made over port 1100 on the same computer. The last command in the Python terminal is:

What needs to be typed in the python terminal to display the input from the netcat session?

Options:

A.

Nothing, as the connection is complete

B.

connection.recv( 1024)

C.

print(remoteip)

D.

Nothing, port 1100 is too low to bind the python server to

Buy Now
Questions 16

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

Options:

A.

SyntaxError: invalid syntax

B.

25

C.

20

D.

15

Buy Now
Questions 17

What will the contents of the "__name__" variable be if the program "gpyc.py" is run as a standalone program?

Options:

A.

The name of the Python version used to create the module

B.

__main__

C.

The name of the GCC compiler used to compile the module

D.

gpyc

Buy Now
Questions 18

Review the following code, written in Python. What are the contents of variable a?

Options:

A.

'cat'/dog'/bird'/violet'

B.

'dandelion', 'rose', 'cat', 'violet', 'bird', 'dog'

C.

'violet'/rose'/dandelion'

D.

'cat'/dog'/bird'

Buy Now
Questions 19

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

Options:

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

Buy Now
Questions 20

Which of the following will be the value of the variable y?

Options:

A.

7

B.

y has no value. The following error occurred: IndexError: list index out of range

C.

6

D.

y has no value. The following error occurred: KeyError: 'b'

Buy Now
Questions 21

Using the Python "sockets" module, which of the following functions looks up the IP address of www.giac.org ?

Options:

A.

socket.gethostbyaddr(" www.giac.org ")

C.

socket.get( www.giac.org)

D.

socket. gethostbynameC'www.giac.org ")

Buy Now
Questions 22

A multi-byte character encoded with UTF-8 has the first byte 11861101. What will the next byte begin with?

Options:

A.

11

B.

01

C.

10

D.

00

Buy Now
Exam Code: GPYC
Exam Name: GIAC Python Coder (GPYC)
Last Update: Oct 10, 2025
Questions: 75
$66  $164.99
$50  $124.99
$42  $104.99
buy now GPYC