nerdexam
Cisco

350-401 · Question #1318

Refer to the exhibit. What is achieved by this Python script?

The correct answer is D. It reads the neighbor count from show lldp neighbors into a dictionary list.. Explanation Option D is correct because the script uses Netmiko to connect to a network device, executes show lldp neighbors, and parses the output using TextFSM (via use_textfsm=True), which structures the raw CLI output into a dictionary-based list - a list of dictionaries wher

Submitted by yasin.bd· Mar 6, 2026Automation

Question

Refer to the exhibit. What is achieved by this Python script?

Exhibits

350-401 question #1318 exhibit 1
350-401 question #1318 exhibit 2

Options

  • AIt displays the Layer 3 neighbors from show lldp neighbors on the terminal screen.
  • BIt reads the output from show lldp neighbors into an array object.
  • CIt displays the output from show lldp neighbors into a standard output.
  • DIt reads the neighbor count from show lldp neighbors into a dictionary list.

How the community answered

(29 responses)
  • A
    3% (1)
  • C
    3% (1)
  • D
    93% (27)

Explanation

Explanation

Option D is correct because the script uses Netmiko to connect to a network device, executes show lldp neighbors, and parses the output using TextFSM (via use_textfsm=True), which structures the raw CLI output into a dictionary-based list - a list of dictionaries where each dictionary represents a discovered neighbor's attributes (e.g., device ID, local interface, capabilities).

  • Option A is wrong because the script doesn't simply print Layer 3 neighbor data to the terminal - it stores structured data, and LLDP operates at Layer 2, not Layer 3.
  • Option B is wrong because the output isn't stored as a plain array; TextFSM parsing produces a list of dictionaries, not a flat array object.
  • Option C is wrong because the script doesn't just display raw output to stdout - it parses and structures the data using TextFSM rather than printing it directly.

Memory Tip: Whenever you see use_textfsm=True in a Netmiko script, think "structured dictionary list" - TextFSM always transforms raw CLI output into key-value pairs (dictionaries), making raw text machine-readable. TextFSM = Transform to Dictionary!

Topics

#Python Scripting#Network Automation#Data Parsing#LLDP

Community Discussion

No community discussion yet for this question.

Full 350-401 Practice