1 + 12
Welcome to our nine-part walkthrough of The Python Tutorial!
This is the official guide for Python, produced and maintained by the developer community. For those interested, the tutorial materials themselves live on Github. You can tell it’s official because
When you search “Python tutorial” online, there’s a lot of results. Some are decent educational materials, others are pretty poor quality and some are AI generated. Only The Python Tutorial is the official one!
You might be concerned by the banner at the top of the page, which reads
Tip: This tutorial is designed for programmers that are new to the Python language, not beginners who are new to programming.
Certainly, this tutorial is not a beginner’s guide to programming. This can make it challenging for newcomers. However, it’s a great, succinct overview of the language, with all the important features covered. So, don’t stress - we’ll just walk you through the important bits.
We’re only going to spend 20 minutes each month on each section. That’s not a lot of time. This means that,
That said, we will cover some important things, and hopefully by November, you’ll have a good, comprehensive handle on how Python actually works.
Here’s a summary of what we’re planning to cover:
| Month | Overview | Section |
| March | Introduction to Python, the interpreter and coding style. | 1-3 and 4.10 |
| April | Control flow tools Conditionals (if, else, elif) Loops (for and while, break and continue) Match-case | 4.1-4.7 |
| May | Functions Defining vs calling Default vs keyword vs positional arguments | 4.8-4.9 |
| June | Data Structures Lists, tuples, sets, dicts Fancy looping And how pandas DataFrames fit into all this | 5 |
| July | Modules How and where to write them How to import them And how PyPI fits into this | 6 |
| August | Input and Output Format strings Reading and writing files | 7 |
| September | Errors and Exceptions Syntax vs everything else Handling and raising them | 8 |
| October | Classes What are they—do I need them? How to write them Attributes vs variables, methods vs functions Who is self? Am I object-oriented? This is a complex topic. We’ll only scratch the surface, but it’ll help explain a lot of Python behaviour. | 9 |
| November | Brief Tour of the Standard Library Modules like os, glob, sys, math, datetime, urllib | 10 |
| December | Something fun :) |
Why Python?
The first section of the tutorial gives us a bit of motivation. Let’s compare with some other popular languages.
As of Feb 2026, the TIOBE index puts Python in pole position:
Top 50%:
Bottom 50%:
What are some uses/features of these other languages?
Some reasons to choose Python
And of course, it’s one big reference to Monty Python!
You might be used to running Python from an IDE (like Spyder), but the simplest way to run Python code is from the interpreter.
This is the same as running it from the console or in your terminal. It’s the thing that interprets your code for the computer.
How you do this depends on your machine. Open up a terminal/shell, then type
If that doesn’t work for you, it’s probably because your computer doesn’t know that you have Python installed, because it hasn’t been added to its default search path for applications. That can happen during installation, particularly if it’s not your machine.
Don’t worry - if you’ve got Python working in an IDE, then just use the console.
You know you’re in the Python interpreter when you see
>>>
rather than $ (bash) or > (Windows).
We’ll go over a few key Python things in the interpreter.
The interpreter can act as a calculator
Some weird operators:
Use strings to store literal text
Use a backslash to include special characters. Need to use print() to see their effect.
This is bad news if you use Windows, because file paths have backslashes.
Prefix your string with an r, i.e. r"...", to ignore the backslashes
Use = to define/assign to variables
Use lists to store multiple values together.
Use square brackets to index and slice
Let’s write a small program and analyse it!
0
1
1
2
3
5
8
Some features
a, b = 0, 1 and a, b = b, a+bwhile a < 10:This section is at the end of chapter 4, but I want to mention it here.
It outlines some key style guides to keep in mind as you program. Take a look!