nerdexam
Cisco

350-401 · Question #1343

Refer to the exhibit. An engineer must pull the interface detail from multiple devices in the network and print out the management IP for the devices based on the JSON responses. VLAN 100 is present o

The correct answer is C. print(json_object["TABLE_intf"]["ROW_intf"][0]["prefix"]). Explanation Option C is correct because json_object is the properly parsed Python dictionary (created via json.loads()), and VLAN 100 - being the first interface entry in the JSON response - is located at index [0] of the ROW_intf list, making json_object["TABLE_intf"]["ROW_intf"

Submitted by the_admin· Mar 6, 2026Automation

Question

Refer to the exhibit. An engineer must pull the interface detail from multiple devices in the network and print out the management IP for the devices based on the JSON responses. VLAN 100 is present on all switches and is used for management. Which line of code must be applied?

Exhibits

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

Options

  • Aprint(json.dumps["TABLE_intf"]["ROW_intf"][2]["prefix"])
  • Bprint(json_object["TABLE_intf"]["ROW_intf"][1]["prefix"])
  • Cprint(json_object["TABLE_intf"]["ROW_intf"][0]["prefix"])
  • Dprint(json.dumps["TABLE_intf"]["ROW_intf"]["prefix"])

How the community answered

(41 responses)
  • A
    7% (3)
  • B
    15% (6)
  • C
    76% (31)
  • D
    2% (1)

Explanation

Explanation

Option C is correct because json_object is the properly parsed Python dictionary (created via json.loads()), and VLAN 100 - being the first interface entry in the JSON response - is located at index [0] of the ROW_intf list, making json_object["TABLE_intf"]["ROW_intf"][0]["prefix"] the correct way to retrieve its IP address.

Why the distractors are wrong:

  • Option A uses json.dumps with square brackets [], which is invalid - json.dumps is a function called with parentheses (), not a subscriptable dictionary object.
  • Option B uses index [1], which would point to the second interface in the list, not VLAN 100 (the first/management interface).
  • Option D uses json.dumps (same invalid syntax as A) and also skips the list index entirely, which would cause a TypeError since ROW_intf is a list, not a dictionary.

Memory Tip: Remember "dumps = strings, loads = objects" - json.dumps() converts a Python object to a JSON string, so you can't index into it like a dictionary. Always use your parsed json_object variable, and recall that Python lists are zero-indexed, so the first item is always [0].

Topics

#JSON Parsing#Python#Network Automation#Data Structures

Community Discussion

No community discussion yet for this question.

Full 350-401 Practice