exam questions

Exam 350-401 All Questions

View all questions & answers for the 350-401 exam

Exam 350-401 topic 1 question 940 discussion

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

DRAG DROP
-

Drag and drop the code snippets from the bottom onto blanks in the Python script so that the program changes the IP address and saves it as a new JSON file on the disk. 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
[Removed]
Highly Voted 1 year ago
i hate such questions :(
upvoted 17 times
...
[Removed]
Most Recent 7 months, 1 week ago
import json with open("json ios xe.json", "r") as json file: json_file_content = json_file.????? decoded_json = json.?????(json_£ile_content) decoded_json[ 'Cisco-IO5-XE-native:interface'] ['GigabitEthernet '] [0] ['ip'] ['address"] ["primary"] ["address'] = \ "192.168.1.2" encoded_json_compact = json.?????(deceded_json) encoded_json indented = json.dumps(decoded json, indent = 4) with open("json ios xe compact.json", "w") as json file: json_£ile.??????(encoded_json_compact) with open("json ios xe indented.json", "w") as json file: json file.write(encoded json indented)
upvoted 1 times
...
chiacche
8 months, 3 weeks ago
read -> load -> dump -> write make sense!!
upvoted 1 times
...
[Removed]
1 year ago
given answer is correct The script reads a JSON file, modifies an IP address within the JSON structure, and then saves the modified JSON in both compact and indented formats into two separate files.
upvoted 1 times
...
sheetal2019
1 year, 1 month ago
given ans should be correct
upvoted 1 times
...
DarthObiGuan
1 year, 1 month ago
This is what I can gather 1. Open some file which contains json data. 2. Read that entire file into a string (json.read) 3. Converts the json string into a python dictionary array (json.load) 4. Modify the IP address of Gi0 to 192.168.1.2 in the python dictionary array 5. Convert the python dictionary array into back to a json string without identation (json.dump) 6 Convert the python dictionary array into back to a json string with indentation (json.dump) 7. Write the json string with and without identation to 2 seperate files (json.write) So I think the provided answer is correct.
upvoted 1 times
...
AzraelOmbrixa
1 year, 3 months ago
brutal question.
upvoted 4 times
...
5eba813
1 year, 3 months ago
anyone can confirm ?
upvoted 1 times
...
cloud29
1 year, 3 months ago
Anyone can explain this?
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 ...