def pyq(x): x[2]=20 y=[10,20,30] x=[0,5,10,15] pyq(y) print (y) ———————— A- [0,5,20,15] B- [0,20,10,15] C- [10,20,30] D- [10,20,20] #Python_quiz

Python_quiz's tweet image. def pyq(x):
        x[2]=20
y=[10,20,30]
x=[0,5,10,15]
pyq(y)
print (y)
————————
A- [0,5,20,15]
B- [0,20,10,15]
C- [10,20,30]
D- [10,20,20]
#Python_quiz

D, the input to the function is y, the function takes the 3rd element of a list (starting with one like regular ppl) and equates it to 20, hence the answer is D.


[10, 20, 20]


United States Tendances
Loading...

Something went wrong.


Something went wrong.