Course: Learn to code from scratch with Python
Complete Python course from scratch to professional level: static typing with mypy, testing with pytest, and best practices from day one.
9Lists in Python: your first data structure
A single variable can only hold one value. Lists hold as many as you need — and let you access, slice, and iterate over them with almost no ceremony.
10List methods in Python: append, remove, and list comprehensions
A list you can't modify is just a tuple with extra steps. Learn to add, remove, and transform elements with the most important list methods — and write your first list comprehensions.
11Defining functions in Python: def, parameters, and return
Learn how to define Python functions with def, pass parameters, return values, and stop your code from becoming an unmaintainable copy-paste chain.
12Advanced function parameters in Python: defaults, *args, and **kwargs
Default parameters, keyword arguments, *args, and **kwargs make your functions flexible. One of them has a trap Python doesn't warn you about before springing it.
13Scope and namespaces in Python: where your variables live
Understand local scope, global scope, nested functions, global, nonlocal, and why Python sometimes seems to hide your variables for sport.