n call ) ?
Regards,
Nikhil
On Tue, May 26, 2009 at 6:29 PM, Christian Witts wrote:
> It is a well known Python gotcha. Take a read through the "Mutable
> defaults for function/method arguments" section of
> http://www.ferg.org/projects/python_gotchas.html#contents_item_6
>
> Hop
Hi,
I am learning Python and came across this example in the Python Online
Tutorial (
http://docs.python.org/tutorial/controlflow.html#default-argument-values)
for Default Argument Values.
ex:
def func(a, L=[ ]):
L.append(a)
return L
print func(1)
print func(2)
print func(3)
*O/P*
[1]
[1,2]
[