Computer Science, asked by lsnshreyascool, 20 days ago

def addToList(listcontainer):
listcontainer += [10]

mylistContainer = [18, 29, 30, 40] addToList(mylistContainer)
print len(mylistContainer)​

Answers

Answered by utkarshdeshmukh2156
0

Answer:

5

Explanation:

In Python, everything is a reference, and references are passed by value. Parameter passing in Python is the same as reference passing in Java. As a consequence, the function can modify the value referred by passed argument, i.e. the value of the variable in the caller’s scope can be changed. Here the task of the function “addToList” is to add an element 10 in the list, So this will increase the length of the list by 1. So the output of the program is 5.

Similar questions