Filters
Question type

Study Flashcards

Using the "gethostbyname('localhost') " function of the socket module will return what IP address?


A) 10.0.0.1
B) 127.0.0.1
C) 169.254.1.1
D) 192.168.1.1

E) A) and B)
F) A) and C)

Correct Answer

verifed

verified

A socket resembles a file object, in that the programmer opens it, receives data from it, and closes it when finished.

A) True
B) False

Correct Answer

verifed

verified

When developing a network application, the programmer can first try it out on a local host-that is, on a standalone computer that may or may not be connected to the Internet.

A) True
B) False

Correct Answer

verifed

verified

The Python function time.currenttime returns a string representing the day/time.

A) True
B) False

Correct Answer

verifed

verified

In order to execute code in a thread as a process, what must be done?


A) The thread's class must implement a run method.
B) The thread's class must implement an exec method.
C) The thread must include the "process" class as a parent.
D) The thread must be told to execute using the exec=yes key.

E) None of the above
F) A) and B)

Correct Answer

verifed

verified

Threads cannot share data between them.

A) True
B) False

Correct Answer

verifed

verified

When a client connects to a server, what does the socket accept method return?


A) A string containing the client's IP address.
B) A list containing the client's IP address and port.
C) A tuple containing the client's socket and its address information.
D) A bytes object containing the client's IP address.

E) A) and B)
F) A) and C)

Correct Answer

verifed

verified

After using the socket.recv method, what type of data is returned?


A) An object of type bytes.
B) A list object containing lines of data separated by carriage returns.
C) A string containing all data that was received.
D) A Boolean value indicating whether the receive was successful.

E) B) and D)
F) All of the above

Correct Answer

verifed

verified

In Python, a thread is an object like any other in that it can hold data, be run with methods, be stored in data structures, and be passed as parameters to methods.

A) True
B) False

Correct Answer

verifed

verified

What thread method can be used to test if the thread is dead or not?


A) isDead()
B) isAlive()
C) isActive()
D) isQueued()

E) C) and D)
F) A) and C)

Correct Answer

verifed

verified

Showing 41 - 50 of 50

Related Exams

Show Answer