exam questions

Exam 350-401 All Questions

View all questions & answers for the 350-401 exam

Exam 350-401 topic 1 question 540 discussion

Actual exam question from Cisco's 350-401
Question #: 540
Topic #: 1
[All 350-401 Questions]

Based on the router's API output in JSON format below, which Python code will display the value of the "role" key?

A.

B.

C.

D.

Show Suggested Answer Hide Answer
Suggested Answer: B

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
[Removed]
6 days, 21 hours ago
B is correct
upvoted 1 times
...
HarwinderSekhon
12 months ago
D is missing " " and response has list [] and you numbers 0, 1, 2 etc to reference list index. B is the answer.
upvoted 1 times
...
shellder
1 year, 4 months ago
Answer is B. response.json() returns a JSON object of the result (if the result was written in JSON format, if not it raises an error). Python requests are generally used to fetch the content from a particular resource URI. Whenever we make a request to a specified URI through Python, it returns a response object. Now, this response object would be used to access certain features such as content, headers, etc. This article revolves around how to check the response.json() out of a response object. It is one of the most used methods in the requests module.
upvoted 2 times
...
poy4242
1 year, 5 months ago
B and D are valid. json.loads(r.text) or r.json() both return the same DIC type...
upvoted 1 times
poy4242
1 year, 5 months ago
B is the good one D is missing the escape caracter '
upvoted 3 times
...
...
nushadu
1 year, 6 months ago
Parse JSON - Convert from JSON to Python If you have a JSON string, you can parse it by using the json.loads() method. The result will be a Python dictionary.
upvoted 1 times
nushadu
1 year, 6 months ago
D. x = {'response': [{ "name": "John", "age": 30, "city": "New York"}] } print(x['response'][0]['age']) == result is 30
upvoted 1 times
nushadu
1 year, 5 months ago
so sorry, D.
upvoted 1 times
nushadu
1 year, 5 months ago
shit happens - B. is correct, sorry for flood, or just remove all my comments here!
upvoted 1 times
...
...
...
...
Gedson
1 year, 6 months ago
La B es correcta,
upvoted 4 times
...
ricaela10
1 year, 6 months ago
based on other sites, answer is D
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago