exam questions

Exam 350-401 All Questions

View all questions & answers for the 350-401 exam

Exam 350-401 topic 1 question 1052 discussion

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



Refer to the exhibit. What is achieved when this Python script is executed?

  • A. All devices that are looped through in the devices.txt file are put into a list that is appended to the parent dictionary.
  • B. All devices that are looped through in the devices.txt file are put into a single dictionary that is appended to the parent list.
  • C. Each device that is looped through in the devices.txt file is put into its own list that is appended to the parent dictionary.
  • D. Each device that is looped through in the devices.txt file is put into its own dictionary that is appended to the parent list.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

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
abrielirus123
4 weeks ago
Selected Answer: D
Explained by Claude AI: 1. The script expects a text file called 'devices.txt' that contains device information in a comma-separated format. 2. The script then reads through the file line by line: for line in file: device_info_list = line.strip().split(',') # Removes whitespace and splits by commas device_info = {} # Creates an empty dictionary for each device 3. For each line, the script creates a dictionary to store the device's information in a more organized way. The strip() method removes any extra whitespace or newline characters, and split(',') breaks the line into a list using commas as separators. 4. The script then assigns each piece of information to specific keys in the dictionary. 5. After creating the dictionary for a device, it's added to the main list. 6. Finally, the script prints the entire list of devices and closes the file.
upvoted 2 times
...
Rfvaz
5 months, 3 weeks ago
Selected Answer: D
Given answer is correct.
upvoted 2 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