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.
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()
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.
DavideDL
Highly Voted 1 year, 3 months ago[Removed]
Most Recent 1 month, 1 week ago[Removed]
1 month, 3 weeks agoHarwinderSekhon
1 year agoMJane
1 year, 3 months agoJackDRipper
1 year, 3 months agoHungarianDish_111
1 year, 3 months agoMJane
1 year, 3 months ago