What value should be passed to make a function use the default argument value?
nospam at jollans.com
Tue Oct 3 23:12:13 CEST 2006
On Tue, 03 Oct 2006 13:16:57 -0700, "LaundroMat" <Laundro at gmail.com> let
> Suppose I have this function:
> def f(var=1):
> return var*2
> What value do I have to pass to f() if I want it to evaluate var to 1?
> I know that f() will return 2, but what if I absolutely want to pass a
> value to f()? "None" doesn't seem to work..
> Thanks in advance.
a) if you feel that your program needs to pass a value, fix the program.
>>> def f(v=1):
... return v*2
*[list] is the reverse of def f(*args)
Thomas Jollans alias free-zombie
More information about the Python-list