nerdexam
Cisco

350-401 · Question #1188

Drag and Drop Question Drag and drop the code snippets from the bottom onto the blanks in the Python script to print the device model to the screen and write JSON data to a file. Not all options are u

The correct answer is print; open; w; dump. The correct sequence uses 'print' to display the device model to the screen, 'open' to create/access a file, 'w' as the write mode argument to open the file for writing, and 'dump' to serialize and write JSON data directly to a file object. The json.dump() function writes JSON to

Submitted by ngozi_ng· Mar 6, 2026Network Automation and Programmability - specifically working with Python scripts to interact with network device data, manipulate JSON data structures, and perform file operations using the json module (commonly tested in CCNA/CCNP DevNet or Network Automation certification tracks).

Question

Drag and Drop Question Drag and drop the code snippets from the bottom onto the blanks in the Python script to print the device model to the screen and write JSON data to a file. Not all options are used. Answer:

Exhibit

350-401 question #1188 exhibit

Answer Area

Drag items

dumpsprintdumpopenrw

Correct arrangement

  • print
  • open
  • w
  • dump

Explanation

The correct sequence uses 'print' to display the device model to the screen, 'open' to create/access a file, 'w' as the write mode argument to open the file for writing, and 'dump' to serialize and write JSON data directly to a file object. The json.dump() function writes JSON to a file object, while json.dumps() only converts to a string without writing to a file, making 'dump' the correct choice for file output.

Topics

#Python scripting#JSON file handling#Network automation#File I/O

Community Discussion

No community discussion yet for this question.

Full 350-401 Practice