Study
Python · Functions: arguments and return values
Defining functions, positional vs keyword arguments, default values, the mutable-default trap, and returning several values.
- Default values are evaluated once, when the function is defined, so never use a mutable default like [].
- Returning a, b actually returns one tuple, which the caller can unpack.