Default argument

Applies to: python, cpp, general

A default argument supplies a value when the caller omits one, keeping common calls short while still allowing customization.

def clamp(x, lo=0, hi=1):
    return max(lo, min(hi, x))

See also: parameter, function