MemotivaVariables, references, and memory model

How does Python pass arguments to functions?

Variables, references, and memory model

Audio flashcard · 0:16

Nortren·

How does Python pass arguments to functions?

0:16

Python uses pass-by-object-reference, sometimes called pass-by-assignment. The function receives a reference to the same object the caller has. Reassigning the parameter inside the function does not affect the caller. Mutating the object in place does affect the caller, because both names reference the same object.
docs.python.org