Python for AI overview
Python is a general-purpose programming language, and the one most AI libraries, model SDKs and agent frameworks are written for.
Last updated: 30 Sep, 2026 · Python 3.14 · Pydantic 2.12
Python was created by Guido van Rossum and first released in 1991. It is free and open source under the PSF License, and the Python Software Foundation looks after it; a new version comes out every October. Its plain syntax made it popular in science and data work, so the libraries for numbers, machine learning and language models grew up around it: NumPy, PyTorch, Hugging Face Transformers, and the SDKs from OpenAI, Anthropic and Google all put Python first.
The parts of Python that AI code uses
AI work uses a small part of the language again and again: text and numbers, lists and dictionaries, functions and classes, files and JSON, error handling, type hints, Pydantic models, and async code for waiting on many model calls at once. This course teaches those parts, in that order, and each lesson uses its idea straight away on the same set of support tickets.
The ticket triage program
The course builds one program. It reads five support tickets from a file, asks a model to sort each one into billing, shipping or other with a priority, checks every answer, and saves the results. It starts with a single line in print() and is finished in Project: ticket triage.
Pick one to watch it run, step by step.
A model, for this course
A model here means a large language model: a program you send text to and get text back from. The agent frameworks later in the roadmap are mostly ways of sending that text, reading the answer and deciding what to do with it.
Most of the course needs no account and no API key. In Stand-in model you write a small function that answers the way a model does, and the program uses it until the last lesson, where one optional section swaps in a real model on a free Groq key.
Where the videos come in
Many lessons open with a short clip from the channel's Python tutorials, placed above the part of the page it teaches. The clips run in a Jupyter notebook; the code on the page is the same idea written as a plain Python file, and where the two differ, a line under the clip says how.
A browser first, Python on your computer later
- A browser, from print() to Timeouts and retries. Each lesson with a finished program has an editor beside it: change the code and press Run.
- Python 3.10 or later on your own computer, from Virtual environments and pip onwards, where you install packages and run tests.
No programming experience is assumed. If you already know some Python, the quiz at the end of each part is a quick way to find the lessons worth reading.
Related
- Next: Installation and setup
- After this course: APIs for AI
- Reference: The Python Tutorial
Every expert started right here.