exam questions

Exam 350-401 All Questions

View all questions & answers for the 350-401 exam

Exam 350-401 topic 1 question 600 discussion

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



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

  • A. print(response['result'][0]('simple_time'])
  • B. print(response['result']['body']( 'simple_time'])
  • C. print(response['body']['simple_time'])
  • D. print(response['jsonrpc']['body'][ 'simple_time'])
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
nushadu
Highly Voted 2 years, 4 months ago
Jesus, why does Cisco ask for programming language skills?
upvoted 36 times
Asymptote
2 years, 3 months ago
becasue it is almost the end of the 350-401, there will be lot more programming question in the coming new CCNP CORE this Fall maybe.
upvoted 8 times
Alondrix
1 year, 6 months ago
And, because the days of the CLI network engineer are coming to an end. We have no choice, learn the new skills or you will age yourself out of the market.
upvoted 4 times
...
...
...
MJane
Highly Voted 2 years, 4 months ago
it's not even programming language skills, it's to learn by heart their API, WHO does that?
upvoted 23 times
...
chmacnp
Most Recent 3 months, 1 week ago
please can someone explain where there is any reference to: - 'result' - 'body or 'simple_time' anywhere in the request? I expect to see some reference to the cmd 'show clock'? What do I not understand? Thanks in advance
upvoted 1 times
matass_md
2 months, 2 weeks ago
I totally agree, this question is about if you understand that the print statement uses a tree to retrieve information like print(response["payload"][0]["params"]["cmd"] or something similar to this . I think it's just a wrong exhibit to the question . to explain a bit , i'm green to in Python but print(response["payload"][0] Zero here is index value from the LIST that is payload . payload = [ ] Square brakets means a list [1,2,3,4] and [0] zero represents the index like in list [1,2,3,4] . In python index start from zero not from one so 1 = index 0, 2= index 1 . 4 would be index 3 . here in our example we have 1 item in the list , and that Item is a Dictionary {key:value, key1:value1} . I advise to ask ChatGPT for Python , it rocks!
upvoted 1 times
...
...
ebulating
9 months ago
This is an absurd question. No one memorizes API structures like this and it is silly to do so.
upvoted 3 times
...
[Removed]
11 months ago
Selected Answer: B
B is correct but it must be print(response.json()['result']['body']['simple_time'])
upvoted 1 times
...
adamzet33
1 year, 5 months ago
print(response['result']['body'][ 'simple_time']), with corrected parenthesis
upvoted 2 times
...
eww_cybr
1 year, 9 months ago
Selected Answer: B
{ "jsonrpc": "2.0", "result": { "body": { "simple_time": "12:31:02.686 UTC Wed Jul 10 2019\n", "time_source": "NTP" } }
upvoted 7 times
Alondrix
1 year, 6 months ago
Is this to imply the format of the payload in the comment is wrong and should be replaced with this? I think 'yes', but no context to this post. There is no 'simple_time' to parse in the posted file. Your answer would make more sense as the result to parse.
upvoted 1 times
...
...
[Removed]
1 year, 10 months ago
This question is dumb.... This is suppose to be a Cisco Network Professional, not a Programmer. This should be in the DevCore.
upvoted 4 times
mgiuseppe86
1 year, 7 months ago
A lot of questions in this test are dumb. Gone are the days of a route/switch/tshoot jocky. Welcome to Cloud, WiFi, JSON, API The art of core networking is becoming lost.
upvoted 3 times
...
...
dragonwise
2 years, 1 month ago
I don't know man. I think this question should be in 350-901 DEVCOR exam
upvoted 4 times
...
SheldonC
2 years, 3 months ago
@M_B The Options are altered. The option that should be there is: #. print(response[‘result’][‘body’][‘simple_time’])
upvoted 4 times
...
M_B
2 years, 3 months ago
I am not a python expert, but A and B seem to have bad syntax as the number of brackets, open and close, do not match. Based on the post by ZiZu007, I would say the answer is D
upvoted 2 times
...
Zizu007
2 years, 5 months ago
Selected Answer: B
B is almost 100% correct, should be response['result']['body']['simple_time'] { "jsonrpc": "2.0", "result": { "body": { "simple_time": "17:53:49.435 UTC Tue Nov 22 2022\n", "time_source": "NTP" } }, "id": 1 }
upvoted 9 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