Python's Argument-Passing Model
Select all that apply. Which of the following statements about how Python passes arguments to functions are true?
- A parameter name is bound to the exact object the caller passed in, not to a copy of its value, which is why calling lst.append(x) on a parameter is visible to the caller.
- Reassigning a parameter inside a function (param = new_value) changes what the caller's variable refers to, because Python passes arguments by reference the way C++ does with &.
- A parameter listed before a bare / in a function signature can only be supplied positionally at the call site.
- A parameter listed after a bare * in a function signature can still be supplied positionally if the caller provides enough positional arguments.
Sign in to answer questions and track your progress
Sign In