Lessons
Defining your own functions
Name a block of code with def and run it whenever you need it.
9 min
Returning values
Send results back with return, and avoid the print-vs-return trap.
10 min
Default and keyword arguments
Make parameters optional and calls readable, and dodge the mutable default trap.
11 min
*args and **kwargs
Accept any number of arguments, and spread lists and dicts into calls.
9 min
Scope: where variables live
Local vs global variables, UnboundLocalError, and why returning beats global.
10 min
Lambdas, docstrings and functions as values
Pass functions around, write one-line lambdas and document your code.
11 min
Next module
Comprehensions & Iteration