Python
Python from absolute zero to confident, idiomatic code. You start with what a program is and how the Python interpreter turns your source into bytecode and runs it, learn the object model early (names are labels bound to objects), and build up through text, control flow, functions, data structures, files and errors, modules, testing, object-oriented design, generators and decorators, type hints, and a look under the hood at dictionaries, memory and concurrency. The track ends with practical projects: a command-line tool and data processing with CSV and JSON. Every lesson explains what actually happens, shows runnable code, and checks your understanding with exercises run in a sandbox.
- Foundations
What a program is, how the Python interpreter runs source code via bytecode, the REPL versus scripts, and your first programs that print and read input.- What a program is · 25 min · 4 exercises
- How Python runs your code · 30 min · 4 exercises
- The REPL, scripts, print and comments · 30 min · 4 exercises
- Reading input: your first interactive program · 35 min · 4 exercises
- Values, types and names
Everything is an object with a type; names are labels bound to objects. Integers, floats, booleans, None, and converting between types.- Everything is an object: values and types · 30 min · 4 exercises
- Names bind to objects · 40 min · 5 exercises
- Integers and floats · 40 min · 4 exercises
- Booleans and None · 30 min · 5 exercises
- Converting between types · 35 min · 5 exercises
- Expressions and operators
Arithmetic, precedence, integer division and modulo, comparisons, boolean logic with short-circuiting and truthiness, and assignment forms.- Arithmetic operators and precedence · 35 min · 4 exercises
- Comparisons, boolean logic and truthiness · 40 min · 5 exercises
- Assignment forms · 35 min · 5 exercises
- Bitwise operators and number bases · 40 min · 5 exercises
- Strings and text
Strings as immutable sequences: indexing and slicing, the essential methods, f-string formatting, and how Unicode text relates to bytes.- Strings are sequences: indexing, slicing and immutability · 35 min · 5 exercises
- Essential string methods · 40 min · 5 exercises
- Formatting with f-strings · 40 min · 5 exercises
- Unicode, code points and bytes · 40 min · 5 exercises
- Control flow
Making decisions with if/elif/else, repeating with while and for, break/continue/else on loops, and structural pattern matching with match.- Making decisions: if, elif and else · 40 min · 5 exercises
- Repeating with while · 40 min · 5 exercises
- for loops and range · 40 min · 5 exercises
- break, continue and loop else · 35 min · 4 exercises
- Structural pattern matching with match · 40 min · 4 exercises
- Functions
Defining and calling functions, return values, parameters and arguments of every kind, scope and the LEGB rule, docstrings, and recursion.- Defining and calling functions · 35 min · 4 exercises
- Parameters and arguments · 45 min · 5 exercises
- Scope: local, global and the LEGB rule · 40 min · 5 exercises
- Docstrings and designing good functions · 40 min · 3 exercises
- Recursion · 45 min · 5 exercises
- Lists, tuples, dicts and sets
Python's core containers, what each is good at and what it costs, and the crucial ideas of mutability, aliasing and copying.- Lists · 45 min · 5 exercises
- Tuples and unpacking · 40 min · 5 exercises
- Dictionaries · 45 min · 5 exercises
- Sets · 40 min · 5 exercises
- Mutability, aliasing and copying · 45 min · 6 exercises
- Iteration
How for really works, enumerate, zip, sorted and key functions, comprehensions, and the built-ins that consume iterables.- How for really works: iterables and iterators · 35 min · 4 exercises
- enumerate, zip and reversed · 35 min · 4 exercises
- Sorting with sorted and key functions · 40 min · 5 exercises
- Comprehensions · 40 min · 5 exercises
- Built-ins that consume iterables · 40 min · 5 exercises
- Errors, exceptions and files
Reading tracebacks, handling and raising exceptions, defining your own, working with files safely using with and pathlib, and talking to the outside world through stdin, stdout, stderr and exit codes.- Reading tracebacks and the exception hierarchy · 35 min · 4 exercises
- Handling exceptions: try, except, else and finally · 40 min · 5 exercises
- Raising exceptions and defining your own · 40 min · 4 exercises
- Files: open, read, write and with · 45 min · 5 exercises
- Paths and the file system with pathlib · 40 min · 4 exercises
- stdin, stdout, stderr and exit codes · 45 min · 4 exercises
- Modules, packages and the standard library
How import works, writing your own modules and packages, the __name__ == '__main__' idiom, and a guided tour of the most useful standard library modules.- Modules and how import works · 40 min · 4 exercises
- Writing your own modules and the __main__ idiom · 40 min · 4 exercises
- Packages · 40 min · 4 exercises
- Standard library tour I: collections, itertools and functools · 50 min · 5 exercises
- Standard library tour II: math, random, datetime and os · 50 min · 5 exercises
- Testing and debugging
Thinking in tests, assert, the unittest framework, and finding bugs systematically with tracebacks, print, logging and pdb.- Thinking in tests and assert · 45 min · 4 exercises
- Testing with unittest · 50 min · 4 exercises
- Debugging: tracebacks, print and logging · 50 min · 4 exercises
- Debugging with pdb and breakpoint() · 45 min · 4 exercises
- Object-oriented Python
Classes and instances, methods and attributes, special (dunder) methods, inheritance versus composition, properties, and dataclasses.- Classes and instances · 40 min · 4 exercises
- Special (dunder) methods · 45 min · 4 exercises
- Class attributes, properties and encapsulation · 45 min · 4 exercises
- Inheritance, super() and composition · 50 min · 4 exercises
- Dataclasses and enums · 45 min · 4 exercises
- Iterators, generators, closures and decorators
The iterator protocol, generator functions and expressions, closures, decorators, context managers, and type hints for documenting and checking your code.- The iterator protocol · 40 min · 4 exercises
- Generators · 45 min · 4 exercises
- Functions as objects, lambdas and closures · 45 min · 4 exercises
- Decorators · 50 min · 4 exercises
- Context managers · 45 min · 4 exercises
- Type hints · 45 min · 4 exercises
- Under the hood: internals and concurrency
How dicts and hashing work, memory management with reference counting and the garbage collector, the GIL, threads, processes, and asyncio.- How dicts and sets work: hashing · 45 min · 4 exercises
- Memory: references, reference counting and the garbage collector · 45 min · 4 exercises
- Threads and the GIL · 50 min · 3 exercises
- Processes and concurrent.futures · 45 min · 4 exercises
- asyncio basics · 50 min · 4 exercises
- Practical projects
Putting it together: a real command-line tool with argparse, processing CSV and JSON data, and a text-analysis program built and tested end to end.- Building a command-line tool with argparse · 50 min · 4 exercises
- Processing CSV data · 50 min · 4 exercises
- Working with JSON · 45 min · 4 exercises
- Project: a log analyzer from start to finish · 75 min · 4 exercises
- Project: a to-do manager with subcommands and JSON storage · 75 min · 4 exercises