In Python, what value can a variable take, so that when a function is invoked with the variable as an argument, the function uses its default value for the parameter instead?
Consider the following code:
def foo(a=100):
print(a)
b = None #blank value
foo(b)
Desired output:
100
Actual output:
None
I hypothesized that None would work, but clearly it doesn't. What value can I choose for b, so that foo(b) is equivalent to foo()? Or is this simply not possible? I'm in a situation where the value for b can either be defined, or I would like to use the default value of the parameter.