nerdexam
Cisco

350-401 · Question #702

Refer to the exhibit. Which Python code parses the response and prints "18:32:21.474 UTC Sun Mar 10 2019"?

The correct answer is B. print(response[result']['body']['simple_time']}. To correctly extract a specific value from a nested JSON structure in Python, you must use a sequence of dictionary key accesses matching the data's hierarchy.

Submitted by minji_kr· Mar 6, 2026Network Automation

Question

Refer to the exhibit. Which Python code parses the response and prints "18:32:21.474 UTC Sun Mar 10 2019"?

Exhibits

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

Options

  • Aprint(response['resut'][0||'simple_time']}
  • Bprint(response[result']['body']['simple_time']}
  • Cprint(response['body']['simple_time']}
  • Dprint(response[jresult']['body']['simple_time']}

How the community answered

(46 responses)
  • A
    7% (3)
  • B
    76% (35)
  • C
    13% (6)
  • D
    4% (2)

Why each option

To correctly extract a specific value from a nested JSON structure in Python, you must use a sequence of dictionary key accesses matching the data's hierarchy.

Aprint(response['resut'][0||'simple_time']}

This option contains a typo ('resut' instead of 'result') and uses an incorrect indexing or access method ('[0||'simple_time']'), which is not valid Python syntax for dictionary access.

Bprint(response[result']['body']['simple_time']}Correct

Given a JSON response where 'simple_time' is nested within 'body', which is itself nested within 'result', the correct Python code to access this value is `response['result']['body']['simple_time']`. This path correctly navigates through the dictionary keys to retrieve the desired string.

Cprint(response['body']['simple_time']}

This option incorrectly assumes that 'body' is a top-level key directly under 'response', skipping the 'result' key in the JSON structure.

Dprint(response[jresult']['body']['simple_time']}

This option contains a typo ('jresult' instead of 'result'), which would cause a KeyError when attempting to access the dictionary.

Concept tested: Python JSON parsing and dictionary access

Source: https://docs.python.org/3/library/json.html#json.loads

Topics

#Python dictionary#JSON parsing#API response

Community Discussion

No community discussion yet for this question.

Full 350-401 Practice