mediumMultiple ChoiceObjective-mapped
CCNP Practice Question: An engineer retrieves telemetry data from a Cisco…
An engineer retrieves telemetry data from a Cisco IOS-XE device using RESTCONF and receives the following response:
```json
{"ietf-interfaces:interfaces": {
"interface": [
{
"name": "GigabitEthernet1",
"type": "iana-if-type:ethernetCsmacd",
"enabled": true,
"ipv4": {
"address": [
{
"ip": "192.168.1.1",
"netmask": "255.255.255.0"
}
]
}
}
]
}
}```
What is the correct way to access the IP address of the interface using Python?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
data['ietf-interfaces:interfaces']['interface'][0]['ipv4']['address'][0]['ip']
The JSON response is nested. To access the IP address, you need to navigate through the dictionary: data['ietf-interfaces:interfaces']['interface'][0]['ipv4']['address'][0]['ip']. This returns '192.168.1.1'.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
data['ietf-interfaces:interfaces']['interface'][0]['ipv4']['address'][0]['ip']
Why this is correct
This correctly navigates the nested JSON structure.
- ✗
data['interface'][0]['ipv4']['address']['ip']
Why it's wrong here
Missing the top-level key 'ietf-interfaces:interfaces'.
- ✗
data['interfaces']['interface']['ipv4']['address']['ip']
Why it's wrong here
The key is 'ietf-interfaces:interfaces', not 'interfaces', and the interface list requires index.
- ✗
data['ietf-interfaces:interfaces']['interface']['ipv4']['address'][0]['ip']
Why it's wrong here
Missing the list index for 'interface'; it should be [0].
About these practice questions
One of 1,175 original 350-401 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 350-401 practice question is part of Courseiva's free Cisco certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 350-401 exam.