CCNP 350-401 ENCOR Question 592 DISCUSSION
« Back to Main MenuBased on the router's API output in JSON format below, which Python code will display the value of the `hostname` key?
A.
json_data= json.loads(response.text)
print(json_data['response']['family'][hostname])
B.
json_data = response.json()
print(json_data['response'][0]['hostname'])
C.
json_data = json.loads(response.text)
print(json_data[response][0][hostname])
D.
json_data = response.json()
print(json_data['response'][family][hostname])
Based on the router's API output in JSON format below, which Python code will display the value of the `hostname` key?
A.
json_data= json.loads(response.text)
print(json_data['response']['family'][hostname])
B.
json_data = response.json()
print(json_data['response'][0]['hostname'])
C.
json_data = json.loads(response.text)
print(json_data[response][0][hostname])
D.
json_data = response.json()
print(json_data['response'][family][hostname])
Correct Answer: B