2

I'm new to python, and lately the following question puzzled me. The correct output is: [1,2,3] Could anyone explain to me why? It's so confusing.

def f(i, values = []):
    values.append(i)
    return values

f(1)
f(2)
v = f(3)
print(v)
highsky
  • 125
  • 3
  • 11

0 Answers0