CCNP 350-401 ENCOR Question 325 DISCUSSION
« Back to Main MenuBased on the output below, which Python code shows the value of the "upTime" key?
{
"response": [{
"family": "Routers",
"type. "Cisco ASR 1001-X Router",
"errorCode": null
"location": null,macAddress" "00:c8:8b:80:bc:00",
"hostname": "asr1001-x abcinc",
"role": "BORDER ROUTER",
"lastUpdateTime": 1577391777128,
"serialNumber":"FXS1932Q2SE",
"softwareeVersion": "16.3.2",
"locationName": null,
"upTime":"49 days. 13:43:44:231",
"lastUpdated": "2019-12-22 14:55:23"
}]
}
A. json_data = json.loads(response text)
print(json_datalresponsel['family']['upTime'])
B. json_data = response.json()
print(json_data['response'][0]['upTime'])
C. json_data = response.json()
print(json_data)['response'][family]['upTime'])
D. json_data = response.json()
print(json_data['response'][0][upTime])
Based on the output below, which Python code shows the value of the "upTime" key?
{
"response": [{
"family": "Routers",
"type. "Cisco ASR 1001-X Router",
"errorCode": null
"location": null,macAddress" "00:c8:8b:80:bc:00",
"hostname": "asr1001-x abcinc",
"role": "BORDER ROUTER",
"lastUpdateTime": 1577391777128,
"serialNumber":"FXS1932Q2SE",
"softwareeVersion": "16.3.2",
"locationName": null,
"upTime":"49 days. 13:43:44:231",
"lastUpdated": "2019-12-22 14:55:23"
}]
}
A. json_data = json.loads(response text)
print(json_datalresponsel['family']['upTime'])
B. json_data = response.json()
print(json_data['response'][0]['upTime'])
C. json_data = response.json()
print(json_data)['response'][family]['upTime'])
D. json_data = response.json()
print(json_data['response'][0][upTime])
Correct Answer: B