giac gpyc practice test

GIAC Python Coder

Last exam update: Nov 18 ,2025
Page 1 out of 5. Viewing questions 1-15 out of 75

Question 1

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

  • 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'
Mark Question:
Answer:

C

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 2

What are the contents of the variable x when the following is executed in a Python interactive
session?

  • A. 'So'
  • B. 'So you'
  • C. 'So you want a GIAC Certification?'
  • D. 'So', 'you’
Mark Question:
Answer:

C

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 3

Which of the following commands would correct the error in the screenshot?

  • A. import itertools
  • B. modulus itertools
  • C. return itertools
  • D. define itertools
Mark Question:
Answer:

A

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 4

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

  • A. Casting
  • B. Exception handling
  • C. Dictionaries
  • D. Regular expressions
Mark Question:
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 5

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

  • 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
Mark Question:
Answer:

A

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 6

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

  • A. 'cat'/dog'/bird'/violet'
  • B. 'dandelion', 'rose', 'cat', 'violet', 'bird', 'dog'
  • C. 'violet'/rose'/dandelion'
  • D. 'cat'/dog'/bird'
Mark Question:
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 7

When the following program "question.py" is executed with Python what is the output?

  • A. 10
  • B. 5
  • C. FunctionOverride: function i assigned not called
  • D. Function i at 0xb7489764>
Mark Question:
Answer:

B


Explanation:
i = I (10)
it should be i = i (10)

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 8

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

  • A. 0b10101
  • B. 18
  • C. 0b10010
  • D. 0b101101
Mark Question:
Answer:

C

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 9

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

  • A. range(l,4) + 64
  • B. for x(4)+64
  • C. map(ord, "ABCD")
  • D. range(4)+ 65
Mark Question:
Answer:

D

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 10

What is the output of the Is(TCP) function?

  • A. It lists all of the TCP port numbers in a TCP stream
  • B. It lists all of the packets that have a TCP layer
  • C. It lists the contents of the TCP layer
  • D. It lists all of the fields associated with the TCP layer
Mark Question:
Answer:

A

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 11

What happens if a programmer fails to build exception handling into a program, and the program
encounters an unexpected error condition?

  • A. The interpreter will ignore the error and move to the next line
  • B. The application will print a warning to the console and continue to the end
  • C. The computer will "fuzz" input until it finds one that generates no error
  • D. The application will terminate immediately or after resources are exhausted
Mark Question:
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 12

Review the following Python 3 code.

  • A. 539
  • B. 4a6e
  • C. (52-4)
  • D. three
Mark Question:
Answer:

A

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 13

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

  • A. SyntaxError: invalid syntax
  • B. 25
  • C. 20
  • D. 15
Mark Question:
Answer:

C

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 14

After calling a subprocess in a Python program, the program returns an error code of "0". What does
this indicate?

  • A. The subprocess did not run
  • B. The subprocess terminated with no errors
  • C. The subprocess entered an infinite loop condition
  • D. The subprocess encountered a race condition
Mark Question:
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 15

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

  • A. SyntaxError: invalid syntax
  • B. True
  • C. False
Mark Question:
Answer:

C

User Votes:
A
50%
B
50%
C
50%
Discussions
vote your answer:
A
B
C
0 / 1000
To page 2