A free, hands-on course that takes you from zero to confident with Python — no prior experience needed. Every lesson is short and practical, with runnable examples and exercises (and solutions) so you learn by doing.
Two ways to learn:
- ▶ Interactive (in your browser): run and edit every example live — no install. See Run the interactive course.
- 📖 Plain files: read the Markdown lessons and run the
.pyfiles in any editor. Great on GitHub or offline.
- New to Python? Read SETUP.md to install Python (or run the browser version) and write your first program.
- Ready to learn? Start with 01 · Variables and work straight down the list below.
- Done with the basics? Build the capstone projects.
Each lesson folder contains:
course/NN-topic/
README.md ← the lesson (start here)
examples/ ← runnable example scripts
exercises/ ← practice files with TODOs
solutions/ ← worked answers (peek after you try!)
- Variables
- Data Types & Numbers
- Strings
- Booleans & Comparison
- Operators, Expressions & Statements
- Conditionals
- Loops
- Input & Output
The web/ folder is a small site that renders the lessons and runs Python right
in your browser via Pyodide — your code never leaves your
machine.
# from the project root
python3 -m http.server 8000Then open http://localhost:8000/web/. Read a lesson, edit any example, and hit ▶ Run. (A local server is needed so the page can load the lesson files; a modern browser is the only other requirement.)
- Open an exercise file — the task and the expected output are in the comment at the top.
- Write your code where it says
# TODO. - Run it:
python course/<module>/exercises/<file>.py. - Compare with the matching file in
solutions/.
Get stuck and experiment — that's where the learning happens.
Found a typo or have an idea for a clearer example or new exercise? Contributions are very welcome — see CONTRIBUTING.md.
Released under the MIT License — free to use, share, and adapt.