exam questions

Exam 350-401 All Questions

View all questions & answers for the 350-401 exam

Exam 350-401 topic 1 question 757 discussion

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



Refer to the exhibit. What is the result of running this code?

  • A. A list of lists is created.
  • B. A list of new VLANs is created.
  • C. An error is displayed.
  • D. A dictionary is created.
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
DavideDL
Highly Voted 1 year, 2 months ago
Selected Answer: B
vlans_list is a python list contaning the numbers: 10 , 20 and 30 (as integers) The function "add_vlans" scan the list and 100 to every item. The result should be: [110, 120, 130] So in my opinion the answer should be: [B] - A list of new VLANs is created.
upvoted 6 times
...
[Removed]
Most Recent 2 days, 14 hours ago
Selected Answer: B
B is correct
upvoted 1 times
...
[Removed]
2 weeks, 3 days ago
i trust the comments, going with B
upvoted 1 times
...
HarwinderSekhon
11 months, 2 weeks ago
Tested vlans_list = [10, 20, 30] def add_vlans(vlans): for i in range(len(vlans)): vlans[i]+=100 add_vlans(vlans_list) print(vlans_list) [110, 120, 130]
upvoted 2 times
...
MJane
1 year, 2 months ago
Selected Answer: B
tried it online. the thing is that the vars are referenced and not sent by value. def main(): vlans_list = [10, 20, 30] add_vlans(vlans_list) print(vlans_list) def add_vlans(vlans): for i in range(len(vlans)): vlans[i]+=100 if _name_ == '_main_': main()
upvoted 2 times
...
JackDRipper
1 year, 2 months ago
Selected Answer: B
def main(): vlans_list = [10,20,30] add_vlans(vlans_list) print(vlans_list) def add_vlans(vlans): for i in range(len(vlans)): vlans[i]+=100 if __name__=='__main__': main() ===============OUTPUT=============== [110, 120, 130]
upvoted 2 times
...
HungarianDish_111
1 year, 2 months ago
Selected Answer: C
Run in Visual Studio. In this for it always throws an error. "NameError: name '_name_' is not defined" Could someone double check this please?
upvoted 1 times
MJane
1 year, 2 months ago
you are missing an _. there should be 2x_
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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago