What value should be passed to make a function use the default argument value?

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Tue Oct 3 23:55:46 CEST 2006

LaundroMat a écrit :
> 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..

Have you tried f(1) ?

More information about the Python-list mailing list