350-401 · Question #1318
350-401 Question #1318: Real Exam Question with Answer & Explanation
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
Question
Refer to the exhibit. What is achieved by this Python script?
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.
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=Truein 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
Community Discussion
No community discussion yet for this question.