Lesson 2.1
Parameters and Arguments
Python passes references to objects. Rebinding a parameter inside a function does not affect the caller, but mutating a mutable argument does.
Decomposition, and the scope rules that make it safe. This is the unit that decides whether later programs stay readable as they grow.
Lesson 2.1
Python passes references to objects. Rebinding a parameter inside a function does not affect the caller, but mutating a mutable argument does.
Lesson 2.2
A function without an explicit return yields the null object. Returning is different from printing, and only one of them is usable by the caller.
Lesson 2.3
Names assigned inside a function are local unless declared otherwise. Reading an outer name works; assigning to it creates a new local one.
Lesson 2.4
Defaults are evaluated once when the function is defined, so a mutable default is shared across every call.
Work through questions with a tutor and get help with the steps you find difficult.
Get help with this topic