5-6 Devasc Book Flashcards

1
Q

When parsing a text file, what determines the end of a line?
a. Return code

b. Nothing; Python sees it as one big string
c. \n or EoF
d. All of the above

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What syntax would you use to open a text file to be written to?

a. data = open(“text.txt”, “w”)
b. data = load(“text.txt”, “w”)
c. load(“text.txt”, “w”)
d. open(“text.txt”, “w”)

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which of the following do you use to write to a CSV file in Python?

a. with open(“text.csv”, “a”) as filehandle:
csv_writer = csv.write(filehandle)
csv_writer.writerow(data)
b. with open(“text.csv”, “a”) as filehandle:
csv_writer.writerow(data)
c. with open(“text.csv”, “a”) as filehandle:
csv_writer = csv.writer(filehandle)
csv_writer.writerow(data)
d. with open(“text.csv”, “a”) as filehandle:
csv_writer = csv.writer(f)
csv_writer.writerow(data)

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which module is imported to read XML data?

a. xmlm
b. xmltodict
c. XMLParse
d. None of the above

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which methods are used for converting a native JSON file to Python and then back to
JSON? (Choose two.)**
\
a. load() and dump()
b. loads() and dump()
c. loads() and dumps()
d. load() and dumps()

A

A,C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does YAML stand for?

a. Yet Another Markup Language
b. YAML Ain’t Markup Language
c. The name of its creator
d. None of the above

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the syntax for error handling in Python?

a. try-except-else-finally
b. raise ErrorMessage
c. assertErrorValue
d. All of the above

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

When does the finally block execute?

a. After the try block is successful
b. After the except block
c. At the end of every try block
d. When an error code stops the else block

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Test-driven development requires that developers:

a. Create a unit test for every bit of code they write
b. Know how to use DevOps tools for automated testing
c. Create a simple test that fails and then write code that allows the test to succeed
d. Completely unnecessary in an Agile development shop

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the difference between a unit test and an integration test? (Choose two.)

a. An integration test is for validation of how different parts of the application work
together.
b. An integration test verifies that the application operates as expected.
c. A unit test verifies API functionality.
d. A unit test is most specific in scope and tests small bits of code.

A

A,D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which class is inherited as part of a unit test?

a. unittest.testcase
b. unittest.TestCase
c. unittest
d. TestCase

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which of the following is a sample use case of a southbound API?

a. Pushing network configuration changes down to devices
b. Increasing security
c. Streaming telemetry
d. Sending information to the cloud

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are some benefits of using asynchronous APIs? (Choose two.)

a. Not having to wait on a response to process data
b. Reduced processing time
c. Increased processing time
d. Data function reuse

A

A,B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the HTTP functions used for API communication? (Choose three.)

a. GET
b. SOURCE
c. PURGE
d. PATCH
e. PUT

A

A,D,E

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

True or false: RESTful API authentication can use API keys or custom tokens.

a. True
b. False

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What does SOAP stand for?

a. Software Operations and Procedures
b. Software Operations Authentication Protocol
c. Simple Object Access Protocol
d. Simple Operations Automation Platform
e. Support Object Abstract Protocol

A

C

17
Q

What are the main components of SOAP messages? (Choose all that apply.)

a. Envelope
b. Header
c. Destination
d. Body
e. Fault
f. Authentication
g. Source

A

A,B,D,E

18
Q

Remote-procedure calls (RPCs) behave similarly to which of the following?

a. Synchronous API
b. Asynchronous API

A

A