Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam 350-401 All Questions

View all questions & answers for the 350-401 exam

Exam 350-401 topic 1 question 512 discussion

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

An engineer must create a script to append and modify device entries in a JSON-formatted file. The script must work as follows:
✑ Until interrupted from the keyboard, the script reads in the hostname of a device, its management IP address operating system type, and CLI remote access protocol.
✑ After being interrupted, the script displays the entered entries and adds them to the JSON-formatted file, replacing existing entries whose hostname matches.
The contents of the JSON-formatted file are as follows:

Drag and drop the statements onto the blanks within the code to complete the script. Not all options are used.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
MO_2022
Highly Voted 1 year, 9 months ago
1. import json 2. while True: 3. except 4. File = open 5. File.close()
upvoted 32 times
...
Arnaud_R1
Highly Voted 2 years ago
In that case, it should be File = open instead of File.open() "File" is not defined in the script before, so no method can be applied to it. Also, the parenthesis after the blank field help us here.
upvoted 15 times
x3rox
1 year, 7 months ago
Thank you mate!
upvoted 1 times
...
...
sharonmiller
Most Recent 1 month, 2 weeks ago
out of 1000 questions, this may be the only json question I actually got correct lol
upvoted 2 times
...
SeMo0o0o
3 months ago
given answer is incorrect import json while True: except File = open File.close()
upvoted 1 times
SeMo0o0o
2 months, 2 weeks ago
....................
upvoted 2 times
...
...
SeMo0o0o
3 months, 4 weeks ago
correct
upvoted 2 times
SeMo0o0o
3 months, 1 week ago
i misread it, given answer is incorrect
upvoted 2 times
...
...
wengzaii96
5 months, 2 weeks ago
I thought I was learning programming instead of networking. Nowadays people are using software-defined
upvoted 1 times
...
eojedad
1 year, 6 months ago
definitly is File = open, compared to question 496 ...outfile = open(...)
upvoted 1 times
...
nushadu
1 year, 8 months ago
JSON Library in Python Method >>>>>>>>> Description dumps() >>>>>>>>> encoding to JSON objects dump() >>>>>>>>> encoded string writing on file loads() >>>>>>>>> Decode the JSON string load() >>>>>>>>> Decode while JSON file read
upvoted 5 times
...
ccnptoppler34
1 year, 12 months ago
it should be File = open instead of File.open()
upvoted 9 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 ...