Free

Python for Beginners

From setting up your environment through conditionals, loops, data structures, functions and classes, all the way to debugging. Fifty lessons that take you to the point where you can read code, write it, and fix it yourself. Most lessons let you run the code right there in the browser.

about 6 hours in total (estimate)

Slides for this course (for classes and in-house training) →

Curriculum

The 50 lessons are grouped into seven chapters. Working through them in order is the best way, but you are welcome to dip into whatever interests you.

Chapter 1 — Getting started (lessons 1–8)

From setting up your environment through print, variables, types and strings, to reading error messages. Come out the other side and you can write code and run it yourself.

Chapter 2 — Control flow (lessons 9–15)

Branch with if, repeat with while and for. You gather the tools that give a program its flow, and finish by building a number-guessing game.

Chapter 3 — Data structures (lessons 16–24)

Lists, tuples, dictionaries and sets. Once you can handle several pieces of data at once, the range of things you can write grows enormously.

Chapter 4 — Functions (lessons 25–32)

Give a piece of work a name and pull it out. You cover arguments, return values and scope, then tidy long code by splitting it into functions.

Chapter 5 — Error handling and files (lessons 33–39)

Catch exceptions, read and write files, CSV and JSON, and split your code into modules. This is the foundation of a program people actually use.

Chapter 6 — Object orientation (lessons 40–46)

Classes and instances, inheritance, special methods and encapsulation. You finish by designing an inventory system with classes.

Chapter 7 — Going further (lessons 47–50)

Virtual environments and third-party libraries, generators, and debugging technique. This chapter hands you the map for everything beyond the course.

Once you have finished all 50 lessons, move on to web development (Next.js), data analysis (ML) or typed development (TypeScript). Membership unlocks every course.