Python 2.x

The legacy version you may still meet in old codebases.

Python 2.x is taught here in 3 lessons, running from The print statement and integer division through to Migrating to Python 3. Each lesson takes one topic, shows the working code, and links onward to the next, so the course can be read straight through in order.

TrackPython & Data Science
Lessons3
LevelBeginner
Reading timeabout 39 minutes
PrerequisitesHelpful, but not required: Pillow

Lessons

  1. The print statement and integer divisionTwo Python 2 behaviours that change results without a warning: print as a statement, and division that floors between integers.
  2. unicode and str are different thingsPython 2 has a bytes type called str and a text type called unicode, plus hidden ASCII conversions that fail on any non-ASCII input.
  3. Migrating to Python 3The concrete changes between the versions, the automated tools, and the semantic diffs a compiler will not catch.

More in Python & Data Science

Python 3 NumPy pandas Matplotlib Jupyter Notebook Flask FastAPI Django SciPy Pillow R Julia

FAQ

How long does the Python 2.x course take?
It has 3 lessons, about 39 minutes of reading. Expect roughly twice that if you type out and run every example.
Do I need prior experience for Python 2.x?
Not strictly. It helps to have read Pillow first, because some lessons build on it, but every lesson explains its own assumptions.
What should I read after Python 2.x?
Continue with R (3 lessons), the next course in Python & Data Science.

Last refreshed 2026-09-18.