exam questions

Exam 350-401 All Questions

View all questions & answers for the 350-401 exam

Exam 350-401 topic 1 question 855 discussion

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

DRAG DROP
-

Drag and drop the code snippets from the bottom onto the blanks in the script to convert a Python object into a compact JSON object by removing space characters. Not all options are used.

Show Suggested Answer Hide Answer
Suggested Answer:

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
studying_1
Highly Voted 1 year, 5 months ago
I guess answer should be "dumps", data. separators If you have a Python object, you can convert it into a JSON string by using the json.dumps() method.
upvoted 26 times
...
scarface35
Highly Voted 1 year, 4 months ago
given answer is wrong import json data = { "measurement":"cpmCPUTotal1minRev", "collectionInterval":"default", "tagCount":"0", "policy":None, "devices": [{"model":"cisco 3500 Series WLC","ipv4":"10.10.10.45"}] } obj=json.dumps(data,separators=(',', ':')) print(obj)
upvoted 7 times
...
chiacche
Most Recent 7 months, 2 weeks ago
json.dumps(data) --> This function converts the Python dictionary data into a JSON string. OUTPUT: {"measurement":"cpmCPUTotal1minRev","collectionInterval":"default","tagCount":"0","policy":null,"devices":[{"model":"cisco 3500 Series WLC","ipv4":"10.10.10.45"}]}
upvoted 1 times
...
[Removed]
10 months, 3 weeks ago
given answer is incorrect "dumps" - data - separators=(',', ':')
upvoted 2 times
[Removed]
10 months ago
......................
upvoted 1 times
...
...
Shri_Fcb10
11 months, 2 weeks ago
I thought CCNP is for Network Engineers not for automation Engineer
upvoted 5 times
...
d4doppelganger
1 year, 1 month ago
json.dumps(): used to serialize Python objects into a JSON formatted string json.loads(): used to deserialize a JSON formatted string into a Python object
upvoted 4 times
...
slacker_at_work
1 year, 1 month ago
Code would indeed (as with the other comments below) look like: import json data = { "measurement": "cpmCPUTotallminRev", "collectionInterval": "default", "tagCount": "0", "policy": None, "devices": [{"model": "Cisco 3500 Series WLC", "ipv4": "10.10.20.52"}] } obj = json.dumps(data, separators=(',', ':')) <======= print(obj)
upvoted 4 times
...
Alondrix
1 year, 6 months ago
Given answer appears correct.
upvoted 1 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