When you define a function in Python with an array parameter, what is the scope of that parameter?
This example is taken from the Python tutorial:
de
There's even less "magic" than you might suspect. This is equivalent to
m = [] def f(a, L=m): L.append(a) return L print f(1) print f(2) print f(3)
m is only created once.
m