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)
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.
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.
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
This section is not available anymore. Please use the main Exam Page.350-401 Exam Questions
Log in to ExamTopics
Sign in:
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.
xdy
Highly Voted 3 years, 1 month agodragonwise
1 year, 8 months agoxziomal9
Highly Voted 3 years, 2 months agoxziomal9
3 years, 2 months agoSaamson
2 years, 5 months ago[Removed]
Most Recent 6 months, 1 week agodue
1 year, 3 months agoVlad_Is_Love_ua
1 year, 8 months agonopenotme123
2 years, 3 months agoFarid77
2 years, 6 months agosnowfox
2 years, 7 months ago[Removed]
2 years, 7 months agoaohashi
2 years, 9 months agobogd
2 years, 9 months agoRickAO76
7 months, 3 weeks agoRickAO76
7 months, 3 weeks agoRickAO76
7 months, 3 weeks agoTungHuy
2 years, 11 months agoWilly78
2 years, 11 months ago