Skip to main content

GPYC Online Exam

GIAC Python Coder (GPYC)

75 questions available ยท Page 1 of 8

View study plans
Question 1 Single choice

Which of the following would produce this list?

[65, 66, 67, 68]
  1. A

    range(l,4) + 64

  2. B

    for x(4)+64

  3. C

    map(ord, "ABCD")

  4. D

    range(4)+ 65

Show answer and explanation

Correct answer: D

Question 2 Single choice

What will the following code in Python 3 result in?

  1. A

    outer x, outer x

  2. B

    inner x, inner x

  3. C

    global x, outer x

  4. D

    NameError, outer

  5. E

    inner x, outer x

Show answer and explanation

Correct answer: A

Question 3 Single choice

Review the following code.

What is the output?

  1. A

    (1,0)

  2. B

    (1,)

  3. C

    (256,)

  4. D

    (\x01#\x00)

Show answer and explanation

Correct answer: C

Question 4 Single choice

Review the following Python code:

  1. A

    'Jones','Johnson'

  2. B

    "Brown'/Williams'

  3. C

    'Brown'/Jones','Johnson','Williams'

  4. D

    'Johnson'/JohnsonVWilliams'/Jones'/Jones'/Brown'

Show answer and explanation

Correct answer: A

Question 5 Single choice

What will the last value of V be when Python executes the following control loop?

  1. A

    4

  2. B

    20

  3. C

    2

  4. D

    18

Show answer and explanation

Correct answer: D

Question 6 Single choice

With a requests session object named "browser", how can the expiration attribute of a cookie named "MUID" from "gpyc.com/" be accessed?

  1. A

    browser.cookies._cooktes['.gpyc.com/MUID'] .expires

  2. B

    browser.cookies._cookies['.gpyc.com'] ['/'] ['MUID'].expires

  3. C

    browser.cookies._cookies.gpyc.com.MUID.expires

  4. D

    browser.cookies.gpyc.com['MUID']. expires

  5. E

    browser.cookies.gpyc.com.MUID.expires

Show answer and explanation

Correct answer: A

Question 7 Single choice

What wilt the code in the screen capture print when executed?

  1. A

    2

  2. B

    4

  3. C

    x

  4. D

    An error

  5. E

    6

Show answer and explanation

Correct answer: A

Question 8 Single choice

When using the Python "sockets" module, which of the following calls is used to transmit data to a specific IP address?

  1. A

    sendto

  2. B

    connect

  3. C

    bind

  4. D

    try

Show answer and explanation

Correct answer: B

Question 9 Single choice

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

>>> print (~100)

  1. A

    ~100

  2. B

    -101

  3. C

    100

Show answer and explanation

Correct answer: B

Question 10 Single choice

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?

  1. A

    Nothing, as the connection is complete

  2. B

    connection.recv( 1024)

  3. C

    print(remoteip)

  4. D

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

Show answer and explanation

Correct answer: D