Python tutorial
Readable, batteries-included language for scripts, data work and automation. 22 short chapters, one idea each, every example runnable in the page.
Who it's for: Absolute beginners, students, and anyone who wants a first language that reads almost like English.
Prerequisites: None. You only need a browser; every lesson has a Run button. Installing Python locally is optional.

How this Python track is organized
The first eight chapters cover the core of the language: running a program, how indentation shapes code, names and values, numbers, text, formatting and decisions. Chapters 9 to 14 introduce the four built-in collections (lists, tuples, dictionaries, sets) and the two loops that walk through them. The rest of the track turns repeated code into functions, handles errors, reuses code through modules, reads and writes files, and ends with classes.
Each chapter assumes only the chapters before it. If you already know another language, skim the summaries at the end of each page and stop where something looks unfamiliar.
All examples are tested on Python 3.9 and also run in your browser on Pyodide, which ships Python 3.12. Where a newer feature such as match exists, the chapter says which version introduced it.
All 22 chapters
- 01Get started
- 02Syntax and comments
- 03Variables
- 04Numbers and math
- 05Strings
- 06f-strings and formatting
- 07Booleans and logic
- 08if, elif, else
- 09Lists
- 10Tuples
- 11Dictionaries
- 12Sets
- 13for loops and range()
- 14while, break, continue
- 15Functions
- 16Default and keyword arguments
- 17Lambda and sorting keys
- 18List comprehensions
- 19Errors and exceptions
- 20Modules and imports
- 21Reading and writing files
- 22Classes and objects
Practice and reference
Final Python quiz (22 questions)Cheat sheet: python string methodsCheat sheet: python lists dictsOfficial Python documentation