The correct answer is A. The dictionary attributes are strings, so they would need to be addressed with quotations. B implies that variables are being specified as the attribute identifiers.
I would be mad to get this question on the exam without seeing it here first. Nothing in the blueprint or cert guide would tell me that I need to know this for the exam.
We either need more context here, or all answers are wrong:
assuming that the ''response text'' is either a string or a dictionary, A, B and D answers are all wrong because neither str, nor dict have methods called json().
From this perspective, only C is correct because json module in python does have a loads() method which takes a string formatted as a json object and returns a dictionary. However, C does a disastrous job at accessing the 'upTime' key. So C is very wrong.
there is no 'family' dictionary inherited. so 'family' options go away.
upTime needs to be type string so 'upTime', as there is no other variable upTime.
A is correct.
Nobody in real life check it with eyes, we all use json formatting tools. Cisco is old school like we are living in old century. Instead ask, how can you format json or what tools can you use.
json is data is typically key:value pairs fo data in a rigid hierarchy, like a tree.
key elements at the same level are separated by commas.
family and uptime are clear at the same level in the tree.
therefore to print uptime, you do not need to reference another same leverl key, such as family.
this take out c and d.
of a & b, all keys are referenced inside of quotes. so Uptime in quotes takes care of that.
As a side note, if uptime were a subtree item falling under family, it would have more brackets in the data element,
and in that case the c/d chaining of subtree elements would make senses. but not here.
The answer is 'A', because the question is asked about 'UpTime', not 'family', both of them are object within array 'response' ,i.e. [ {"family:xxx", "UpTime:xxx"}...
This section is not available anymore. Please use the main Exam Page.350-401 Exam Questions
Log in to ExamTopics
Sign in:
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.
hsjfjbdlw
Highly Voted 3 years, 6 months agoMO_2022
Highly Voted 2 years ago[Removed]
1 year, 6 months ago[Removed]
Most Recent 7 months agoBeehurls
8 months, 4 weeks agoClaudiu1
10 months, 1 week agomp777
1 year, 5 months agoHarwinderSekhon
1 year, 6 months agowr4net
1 year, 7 months agoChiaretta
1 year, 8 months agoMMaris018
1 year, 8 months agojuancarlosdlar
1 year, 11 months agokewokil120
1 year, 11 months agonushadu
2 years agoWooker
2 years, 2 months agoBigMouthDog
2 years, 4 months agoBigMouthDog
2 years, 5 months agoougty
2 years, 7 months ago