Courseiva
easyMultiple ChoiceObjective-mapped

350-401 Practice Question: Is using the Cisco DNA Center REST API to…

A network engineer is using the Cisco DNA Center REST API to retrieve the health score of a specific device. The API response is as follows:

{
  "response": [
    {
      "deviceId": "1234567890",
      "hostname": "Core-Switch-1",
      "score": 8,
      "overallHealth": "good",
      "timestamp": 1623456789
    }
  ],
  "version": "1.0"
}

The engineer wants to extract the 'overallHealth' value. Which Python code correctly extracts it?

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

health = response['response'][0]['overallHealth']

The response is a dictionary with a key 'response' that contains a list. The list has one dictionary. To access 'overallHealth', you need to index the list and then the key.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • health = response['response'][0]['overallHealth']

    Why this is correct

    Correct. This accesses the first element of the list inside 'response' and then retrieves 'overallHealth'.

  • health = response['overallHealth']

    Why it's wrong here

    This would fail because 'overallHealth' is not a top-level key.

  • health = response['response']['overallHealth']

    Why it's wrong here

    This would fail because 'response' contains a list, not a dictionary.

  • health = response[0]['overallHealth']

    Why it's wrong here

    This would fail because the top-level object is a dictionary, not a list.

Go deeper

Related to this question

About these practice questions

This 350-401 question is part of Courseiva's 1,175-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.