exam questions

Exam 350-601 All Questions

View all questions & answers for the 350-601 exam

Exam 350-601 topic 1 question 439 discussion

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



Refer to the exhibit. An engineer uses Python in Cisco NX-OS guest shell to retrieve the configuration of the EIGRP ASN on interface eth1/1. The engineer has written this script:

>>> import json
>>> from cli import*

Which command set must be used to retrieve the value of the 'asn' key?

  • A. >>> output = json.loads(clid('show ip eigrp neighbors'))
    >>> output['TABLE_asn']['ROW_asn']['asn']
  • B. >>> output = json.dumps(clid('show ip eigrp neighbors'))
    >>> output['TABLE_asn']['ROW_asn']['asn']
  • C. >>> output = json.dumps(clid('show ip eigrp neighbors'))
    >>> output['asn']
  • D. >>> output = json.loads(clid('show ip eigrp neighbors'))
    >>> output['asn']
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

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
drduck
Highly Voted 1 year, 1 month ago
Selected Answer: A
It is A since this is the value inside of dict inside of another dict.
upvoted 8 times
JCGO
11 months, 3 weeks ago
clid return Json. A
upvoted 4 times
...
...
camelw
Most Recent 7 months, 2 weeks ago
Parse JSON - Convert from JSON to Python If you have a JSON string, you can parse it by using the json.loads() method. Convert from Python to JSON If you have a Python object, you can convert it into a JSON string by using the json.dumps() method. So, if this is the python code it must be use json.dumps and now which one is correct B or C?
upvoted 1 times
DSAM9
2 months, 1 week ago
Answer is A, This is JSON structure, hence this is parsed to Python. We use json.loads() method. The asn key is nested within TABLE_asn and ROW_asn, so the correct way to access it is through: python output['TABLE_asn']['ROW_asn']['asn']
upvoted 1 times
...
...
wickkkkkkkkkkkkkkkkkk
7 months, 3 weeks ago
Selected Answer: B
upvoted 1 times
...
Huberttheman
1 year, 3 months ago
A or D is correct, not sure but my money is on A
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