1.

What is the output of the following? def foo(i, x=[]): x.append(x.append(i)) return x for i in range(3): y = foo(i) print(y)

A. [[[0]], [[[0]], [1]], [[[0]], [[[0]], [1]], [2]]].
B. [[0], [[0], 1], [[0], [[0], 1], 2]].
C. [0, None, 1, None, 2, None].
D. [[[0]], [[[0]], [1]], [[[0]], [[[0]], [1]], [2]]].
Answer» D. [[[0]], [[[0]], [1]], [[[0]], [[[0]], [1]], [2]]].


Discussion

No Comment Found