exam questions

Exam 350-901 All Questions

View all questions & answers for the 350-901 exam

Exam 350-901 topic 1 question 281 discussion

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



Refer to the exhibit. A developer has created a Python script that retrieves information about the deployment of Cisco wireless access points using REST API. Which two code snippets must be added to the blank in the code to print the value of the userId key instead of printing the full JSON response? (Choose two.)

  • A. for key, value in json.items():
    if key == ‘userId’:
    print('{}'.format(value))
  • B. for key, value in json.dumps(response.text):
    if key in ‘userId’:
    print value
  • C. print json[0][userId]
  • D. print json[‘userId’]
  • E. print json[1][‘userId’]
Show Suggested Answer Hide Answer
Suggested Answer: AD 🗳️

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
kirrim
6 months, 2 weeks ago
Selected Answer: AD
It's AD, I tried this in a Python interpreter and it worked. However, note that the syntax in D is incorrect for Python3, it should be: print(json['userId'])
upvoted 3 times
...
VincentVega
6 months, 4 weeks ago
Selected Answer: AD
AD correct answers
upvoted 1 times
...
fb48
1 year, 3 months ago
Answer AD [0] or [1] in answers C and E suggest the output is a dictionay in a list. But there is no list so only D can be correct.
upvoted 1 times
...
[Removed]
1 year, 3 months ago
Selected Answer: AD
A & D are correct.
upvoted 3 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