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)
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
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)
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
A. socket.SOCK_STREAM
B. socket. AF_NET
C. socket.SOCK_DGRAM
D. socket.socket
During a password guessing attack, which HTTP request method would a Python program most commonly call to submit a usemame and password to a target website?
A. OPTIONS
B. POST
C. CONNECT
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)
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'
Using the Python "sockets" module, which of the following functions looks up the IP address of www.giac.org?
A. socket.gethostbyaddr(" www.giac.org")
B. socket.nslookup.www.giac.org
C. socket.get( www.giac.org)
D. socket. gethostbynameC'www.giac.org")
Which of the following is in the output when programl.py shown below is executed?
A. TypeError: cannot concatenate 'str' and 'int' objects
B. NameError: name "c" is not defined
C. ac
D. 15
What does the following command do? pip search syslog
A. Searches for python modules related to syslog
B. Searches for functions in the syslog module
C. Results in a syntax error for the pip function
D. Determines whether the syslog module is loaded