nerdexam
CiscoCisco

350-401 · Question #356

350-401 Question #356: Real Exam Question with Answer & Explanation

The correct answer is D: json_data = response.json() print(json_data['response'][0]['upTime']). Answer D is correct because when parsing a JSON API response using the requests library, response.json() is the proper method to deserialize the JSON payload into a Python dictionary. The 'response' key contains a list (array), so index [0] is used to access the first element, an

Submitted by ashley.k· Mar 6, 2026Network Programmability and Automation - specifically parsing and consuming REST API responses using Python in the context of Cisco DevNet or CCNP/CCNA certification objectives.

Question

Based on the output below, which Python code shows the value of the "upTime" key? A. B. C. D.

Options

  • Ajson_data = response.json() print(json_data['response'][family]['upTime'])
  • Bjson_data = response.json() print(json_data['response'][0]['upTime'])
  • Cjson_data = json.loads(response.text) print(json_data['response'][family]['upTime'])
  • Djson_data = response.json() print(json_data['response'][0]['upTime'])

Explanation

Answer D is correct because when parsing a JSON API response using the requests library, response.json() is the proper method to deserialize the JSON payload into a Python dictionary. The 'response' key contains a list (array), so index [0] is used to access the first element, and then 'upTime' retrieves the specific key value - this is the standard pattern for navigating nested JSON structures from REST API responses.

Topics

#Python REST API#JSON Parsing#requests Library#Network Automation

Community Discussion

No community discussion yet for this question.

Full 350-401 PracticeBrowse All 350-401 Questions