What is the output of the following code? (Output values marked by ??) >def abc(val, y=[]): y.append(val) return y >abc(3) ?? >abc(4,[1,2]) ?? >abc(10) ??

Questions & AnswersCategory: PythonWhat is the output of the following code? (Output values marked by ??) >def abc(val, y=[]): y.append(val) return y >abc(3) ?? >abc(4,[1,2]) ?? >abc(10) ??
Geek Boy Staff asked 2 years ago

What is the output of the following code? (Output values marked by ??)

>def abc(val, y=[]):
    y.append(val)
    return y

>abc(3)
??
>abc(4,[1,2])
??
>abc(10)
??

a. [3], [1,2,4], [10]
b. [3], [1,2,4,3], [1,2,4,3,10]
c. [3], [1,2,4], [3,10]
d. [3], [1,2,4], [3,1,2,4]