Examveda

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]

D. 1 2 3

Answer: Option C


This Question Belongs to Python Program >> Lists In Python

Join The Discussion

Related Questions on Lists in Python