Question PRG-PY-0063
HardWhat is the output of this program?
funcs = [lambda: i for i in range(3)]
fixed = [lambda i=i: i for i in range(3)]
print([f() for f in funcs], [f() for f in fixed])
- A.
[2, 2, 2] [2, 2, 2]
- B.
[2, 2, 2] [0, 1, 2]
- C.
Sign up free to see the answer and a step-by-step explanation.