exam questions

Exam 350-401 All Questions

View all questions & answers for the 350-401 exam

Exam 350-401 topic 1 question 351 discussion

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


Refer to the exhibit. Which code results in the working Python script displaying a list of network devices from the Cisco DNA Center?

  • A. network_device_list(dnac[ג€hostג€], dnac[ג€usernameג€],dnac[ג€passwordג€]) login = dnac_login(dnac) print(dnac_devices)
  • B. login = dnac_login(dnac[ג€hostג€], dnac[ג€usernameג€], dnac[ג€passwordג€]) network_device_list(dnac, login) print(dnac_devices)
  • C. login = dnac_login(dnac[ג€hostג€], dnac[ג€usernameג€], dnac[ג€passwordג€]) network_device_list(dnac, login) for item in dnac_devices: print(dnac_devices.item)
  • D. network_device_list(dnac[ג€hostג€], dnac[ג€usernameג€], dnac[ג€passwordג€]) login = dnac_login(dnac) for item in dnac_devices: print(dnac_devices.item)
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

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
xdy
Highly Voted 3 years, 1 month ago
A. network_device_list(dnac[host], dnac[username],dnac[password]) login = dnac_login(dnac) print(dnac_devices) B. login = dnac_login(dnac[host], dnac[username], dnac[password]) network_device_list(dnac, login) print(dnac_devices) C. login = dnac_login(dnac[host], dnac[username], dnac[password]) network_device_list(dnac, login) for item in dnac_devices: print(dnac_devices.item) D. network_device_list(dnac[host], dnac[username], dnac[password]) login = dnac_login(dnac) for item in dnac_devices: print(dnac_devices.item)
upvoted 24 times
dragonwise
1 year, 8 months ago
you are a good person. thank you
upvoted 6 times
...
...
xziomal9
Highly Voted 3 years, 2 months ago
The correct answer is: B
upvoted 10 times
xziomal9
3 years, 2 months ago
page 850 from Cert Guide
upvoted 10 times
Saamson
2 years, 5 months ago
Cont. on page 853 Example 28-21 Explanation of the script
upvoted 1 times
...
...
...
[Removed]
Most Recent 6 months, 1 week ago
Selected Answer: B
It´s B We need to log in first to get the token so we proves we are authorized to access the Cisco DNA Center. C is wrong, the line "for item in dnac_devices: print(dnac_devices.item)" dosen´t correctly print the items in the dnac_devices table. The PrettyTable should be printed directly.
upvoted 1 times
...
due
1 year, 3 months ago
Selected Answer: B
Point. login = token. got token by function dnac_login(parameter host,username and password). got device list by function network_device_list(parameter dnac and token). got display by function print(dataset dnac_devices). no need for loop, that is what the pretty table is for. no "item" under dnac_devices function. keyword = login -> network_device_list -> print.
upvoted 3 times
...
Vlad_Is_Love_ua
1 year, 8 months ago
Selected Answer: B
token = dnac_login(dnac['host'], dnac['username'], dnac['password']) network_device_list(dnac, token) print(dnac_devices)
upvoted 4 times
...
nopenotme123
2 years, 3 months ago
Selected Answer: B
This question was literally pulled out of the OCG book.
upvoted 3 times
...
Farid77
2 years, 6 months ago
Selected Answer: B
login = dnac_login(dnac["host"], dnac["username"], dnac["password"]) network_device_list(dnac, login) print(dnac_devices) https://github.com/bigevilbeard/dnac-device-info/blob/master/get_dnac_devices.py
upvoted 3 times
...
snowfox
2 years, 7 months ago
Without Python background, how can we know the answer?
upvoted 6 times
...
[Removed]
2 years, 7 months ago
no need for loop, that is what the pretty table is for
upvoted 3 times
...
aohashi
2 years, 9 months ago
Selected Answer: B
It should be B
upvoted 1 times
...
bogd
2 years, 9 months ago
Selected Answer: B
B. There is no "item" under dnac_devices
upvoted 1 times
RickAO76
7 months, 3 weeks ago
there won't be just fysa - ( just to keep peeps aware) "for" loops work like this below.... "item" is just a variable for the for loop to use to iterate - can be named anything. LIST = [1, 2, 3, 4, 5] for x in LIST: print(x) #output 1 2 3 4 5
upvoted 1 times
RickAO76
7 months, 3 weeks ago
B is still correct though.
upvoted 1 times
...
RickAO76
7 months, 3 weeks ago
If the module "PrettyTable" wasn't being used, C would be the choice to utilize the "for" loop.
upvoted 1 times
...
...
...
TungHuy
2 years, 11 months ago
https://github.com/bigevilbeard/dnac-device-info/blob/master/get_dnac_devices.py
upvoted 3 times
...
Willy78
2 years, 11 months ago
xziomal9 is right. B is the correct answer.
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 ...