ShareYourGroupShareYourGroupPython

All Python lessons, in order

Twenty-one lessons in five stages. Work through them from top to bottom. Each lesson builds on the ones above it, takes fifteen to thirty minutes with its exercises, and ends with a link to the next.

Basics

Decisions and loops

Collections

Functions and modules

Going further

How the stages fit together

Basics gets you printing, storing values in variables, doing sums, handling text and asking the user questions. By the end of it you can write a small calculator-style program that asks for values and prints an answer.

Decisions and loops is where programs come alive. With if a program can choose. With while and for it can repeat. Most people find that this is the stage where programming first feels powerful, and also where the first real confusion appears. Take it slowly and do every exercise.

Collections covers lists, tuples, sets and dictionaries: the ways Python keeps many values together. Real programs are mostly about data, and these four types hold nearly all of it.

Functions and modules teaches you to package code under a name, pass values in, get results out, and use the large library that comes with Python.

Going further adds files, error handling, list comprehensions and a first look at classes. After this stage you can read most beginner-level Python code that you meet elsewhere.

Tips for steady progress

This is an independent learning site. It is not connected with or approved by the Python Software Foundation. "Python" is a trademark of the Python Software Foundation and is used here only to name the language.