exam questions

Exam 350-401 All Questions

View all questions & answers for the 350-401 exam

Exam 350-401 topic 1 question 950 discussion

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

DRAG DROP
-

Drag and drop the code snippets from the bottom onto the blanks in the Python script to print the device model to the screen and write JSON data to a file. 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
aatechler
Highly Voted 1 year ago
json.dump() method used to write Python serialized object as JSON formatted data into a file. json.dumps() method is used to encodes any Python object into JSON formatted String
upvoted 5 times
...
teems5uk
Highly Voted 1 year, 3 months ago
Correct
upvoted 5 times
...
AbdullahMohammad251
Most Recent 7 months, 1 week ago
1st command: Prints the model for the device (which is a Cisco Nexus 3550) 2nd command: Creates a file named "data.json" (if it doesn't exist,) and then writes to this file 3rd command: Converts the Python dictionary "data" into a JSON format, and writes its content into the JSON file "data.json" The provided answers are correct!
upvoted 1 times
...
awsguruking
1 year, 1 month ago
correct answer provided with open("sample.json", "w") as outfile: json.dump(dictionary, outfile)
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