GIAC Python Coder v1.0 (GPYC)

Page:    1 / 5   
Total 76 questions

Review the following Python code:


  • A. ג€˜Jonesג€™, ג€˜Johnsonג€™
  • B. ג€˜Brownג€™, ג€˜Williamsג€™
  • C. ג€˜Brownג€™, ג€˜Jonesג€™, ג€˜Johnsonג€™, ג€˜Williamsג€™
  • D. ג€˜Johnsonג€™, ג€˜Johnsonג€™, ג€˜Williamsג€™, ג€˜Jonesג€™, ג€˜Jonesג€™, ג€˜Brownג€™


Answer : A

What will be printed below if the value of x is 7?


  • A. false
  • B. 7
  • C. true
  • D. 0
  • E. x


Answer : B

Which regular expression will match all date-time stamps for log files of the format shown in the screen capture?


A.

B.

C.

D.



Answer : B

What is the output of the following when executed in a Python shell?


  • A. [[1, 2, 2.5], [3, 4], [5, 6]]
  • B. [[1, 2], [3, 4], [5, 6]]
  • C. [[1, 2], [3, 4]]
  • D. [[1, 2, 2.5], [3, 4]]


Answer : D

What is the cause of the error shown below?


  • 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


Answer : B

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(1, mylist.count(1))
  • C. mylist.replace(1,ג€ג€)
  • D. mylist.remove(1)


Answer : A

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

  • 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


Answer : B

When accessing the hard drive directly, how would the character ג€˜Bג€™ be stored?


  • A. 01000010
  • B. /x42
  • C. 66
  • D. B


Answer : A

Third-party Python modules like Scapy and Beautiful Soup are used for what purpose?

  • A. Generating a compiled
  • B. Parsing and interacting with network traffic
  • C. Debugging Python programs
  • D. Obfuscating code


Answer : B

Which of the following is in the output when program1.py shown below is executed?


  • A. TypeError: cannot concatenate ג€˜strג€™ and ג€˜intג€™ objects
  • B. NameError: name ג€˜cג€™ is not defined
  • C. ac
  • D. 15


Answer : B

Examine the code snippet below. What will be the contents of the variable ג€˜iג€™ during the loops first iteration?


  • A. is
  • B. 1
  • C. 0
  • D. Python


Answer : C

A .gif file has the following attributes:


A small data file called ג€raw_dataג€ contains one gif. Which of the following statements is most likely to successfully extract the file?
A.

B.

C.

D.



Answer : D

What will be printed when the code in the screen capture is run?


  • A. An error
  • B. -1
  • C. 1
  • D. 2
  • E. 3


Answer : E

What does the LIMIT function restrict in an SQL SELECT statement?

  • A. The number of queries that can be run against the table per second.
  • B. The number of records a table is permitted to hold.
  • C. The number of records that will be returned by a request.
  • D. The number of subsequent SELECT statements that can be run against the table


Answer : B

Variable ג€trafficג€ contains a Scapy packet list. A programmer runs the following command: p1=traffic[1]
Which of the following describes the contents of p1, with respect to the ג€trafficג€ packet list?

  • A. All Ethernet layer frames
  • B. The contents of the second packet
  • C. TCP streams with a session ID of 1
  • D. The data stored from the first byte onward


Answer : A

Page:    1 / 5   
Total 76 questions