Vidyalelo
Python · Q88

Python Lists MCQs: Exam Practice for List Concepts

Programming · Python · question 88

Q88

What will be the output of the following Python code? def f(i, values = []): values.append(i) return values f(1) f(2) v = f(3) print(v)

A.
[1] [2] [3]
B.
[1] [1, 2] [1, 2, 3]
C.
[1, 2, 3]
Answer
D.
1 2 3

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board