What Python Is, and Where It Came From 🐍
It is named after a comedy troupe, it was a Christmas project, and it now runs a frightening share of the modern world. Meet your language.
A Christmas holiday project
In December 1989, a Dutch programmer named Guido van Rossum had a quiet holiday and a mild irritation. The languages available to him were either fast and hostile or friendly and useless. So he started building a language that read almost like English, punished you for writing messy layout, and let you get something working before your coffee went cold. He released it publicly in 1991.
He named it after Monty Python's Flying Circus,
not the snake. This is why the official docs are full of spam, eggs and dead parrots,
and why the traditional placeholder names in Python examples are
spam, eggs and ham rather than the boring
foo and bar the rest of the industry uses.
Guido carried the informal title 'Benevolent Dictator For Life' for decades, stepped down in 2018 after a bruising argument about a new syntax feature, and the language is now governed by an elected Steering Council. A language outliving its founder's involvement is a sign of health, not decline.
What actually happens when you run Python
You write a file, say hello.py. You run it. Behind the scenes:
- Your text is parsed. The interpreter reads your file and checks the grammar. If you forgot a bracket, this is where it complains, before anything runs.
- It is compiled to bytecode. Yes, compiled: Python turns your code
into a compact set of instructions for a pretend machine. You will sometimes see these
cached in a
__pycache__folder. That folder is not garbage, and not a virus. - A virtual machine runs the bytecode. This is the part that is genuinely "interpreted": a loop inside CPython reads one bytecode instruction at a time and does it.
"CPython" is the standard Python, written in C, the one you will install. There are others: PyPy (much faster for long-running number crunching), MicroPython (runs on a chip that costs less than a sandwich), and Pyodide, which is CPython compiled to WebAssembly. That last one is why the ▶ run buttons in this course work with no server involved. Your code never leaves your laptop.
Every code block in this school with a ▶ run button executes real Python 3.14 in your browser. Press it. Change the text. Press it again. Nothing you can type will break anything.
print("Hello from a real Python interpreter, running inside a web page.")
Hello from a real Python interpreter, running inside a web page.
Python 2 versus Python 3, and why you can ignore it
For about a decade Python had a painful split. Python 3 arrived in 2008 with sensible but incompatible changes, and the world took twelve years to move. Python 2 was finally retired on 1 January 2020.
Why you care: old tutorials and old Stack Overflow answers are still out there. The
instant tell is print. If you see this:
print "hello" # Python 2. Ancient. Move on.
then the page is at least six years out of date and probably wrong in other ways too.
Modern Python always uses print("hello") with brackets. This course teaches
Python 3.13 and 3.14 conventions throughout.
The Zen of Python
Python ships with a hidden poem. Type import this into a Python prompt and
it prints nineteen aphorisms by Tim Peters about how Python code should feel. The
opening lines:
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
This is not decoration. It explains real design decisions you are about to meet: why Python forces you to indent, why there is usually one obvious way to do a thing, and why the community reacts to clever one-liners the way a librarian reacts to shouting.
'Readability counts' is doing a lot of work in that list. Code is read far more often than it is written. Optimising for the reader is not politeness, it is self-interest with a delay built in.
Where Python sits today
It is consistently at or near the top of every measure of language popularity: the TIOBE index, the Stack Overflow Developer Survey, and GitHub's Octoverse report, which in 2024 recorded Python overtaking JavaScript as the most-used language on GitHub, driven largely by data science and machine learning work.
More useful than the rankings: Python is the default language of scientific computing, the default language of machine learning, one of the two default languages of automation and DevOps, and a first-class option for web backends. Next lesson looks at exactly why, with receipts.
Read the poem
Run this block and read all nineteen lines. Pick the one you disagree with most, and keep it in mind. In six months, see whether you still disagree.
import this
The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!Reveal solution
There is no wrong answer. Most beginners bristle at 'explicit is better than implicit' because explicit code is longer. Most people come around after their first week maintaining someone else's clever implicit code.
(If you noticed the poem is a little odd in places, well spotted. It is a joke as much as a manifesto, and 'unless you're Dutch' is aimed squarely at Guido.)
Date the tutorial
You find a tutorial online containing this line. Should you trust the rest of the page?
print "Total:", totalReveal solution
No. That is Python 2 syntax, dead since January 2020. It will not even run on a modern Python: you will get a SyntaxError. The rest of the page is likely to be similarly stale.
Habit worth forming now: check the date on anything you find, and prefer the official docs at docs.python.org, which are versioned and current.