Default Argument Values: default values are evaluated at the point of function definition : Function Default Argument « Function « Python
- Python
- Function
- Function Default Argument
Default Argument Values: default values are evaluated at the point of function definition

# The default values are evaluated at the point of function definition in the
# defining scope, so that
i = 5
def f(arg=i):
print arg
i = 6
f()
Related examples in the same category