Python for Beginners
Python24 lessons2 hr 55 min
Start Python from zero: the shell, names, numbers, strings, lists, conditionals, loops and functions.
Who this is for
Start here if you have never written a line of code, or if you learned Python once and want the basics back in order. Every note is one idea, one example, and why it matters.
How to use these notes
Read a note, then run the snippet. When the quiz exists for a topic, take it before moving on.
- Read in order once
- Come back by topic later
- Keep the REPL open
Modules
Lessons open in reading order. Each one is a public page.
Basics
8 lessonsThe first pass: running code, names, numbers, text and the core collections.
Data structures
3 lessonsTuples, dictionaries and sets, and when each one is the right shape.
Functions and modules
3 lessonsArguments, scope, and splitting code across files.
Objects and errors
3 lessonsClasses, exceptions, and reading files without leaking handles.
More Python
7 lessonsGo past the basics: comprehensions, generators, decorators, context managers, JSON, types and tests.
