Question: Given the following code, which parameters are passed by value and which are passed by reference? def main ( ) : nbrlist = [ 1

Given the following code, which parameters are passed by value and which are passed by reference?
def main():
nbrlist =[10,20,30]
x =0.5
y =1.0
processList(nbrlist, x, y)
def processList(list, a, b):
a =2.0
for i in range(len(list)):
list[i]= list[i]* b
# The entry point for program execution
if __name__=="__main__":
main()
Question 28 options:
12
a
12
b
12
list
1.
by value
2.
by reference
Question 29(Mandatory)(3.5 points)
What are the final values of j, k, m, & n?
def main():
nbrlist =[10,20,30]
x =3.5
y =2.0
j, k, m, n = processNums(x, y)
def processNums(a, b):
c = a + b
d = a - b
e = a * b
f = a / b
return c, d, e, f
# The entry point for program execution
if __name__=="__main__":
main()
Question 29 options:
123456
m
123456
n
123456
j
123456
k
1.
5.50
2.
1.50
3.
7.00
4.
1.75
5.
3.50
6.
2.00

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!