Intermediate
8h · 24 lessons
Python Intermediate
The Python skills every AI course assumes you already have
4.8rating1,240 enrolledLifetime access
Start free preview
About this course
A focused intermediate Python prerequisite covering comprehensions, typing, decorators, async, packaging, testing and the standard-library patterns you will use in every downstream AI course.
What you'll learn
- Write idiomatic, typed Python that other engineers can read and review
- Use comprehensions, generators, decorators and context managers with confidence
- Structure real projects with packages, virtualenvs and dependency pinning
- Write async code, tests and error handling you can rely on before starting any AI course
Requirements
- Comfortable with Python basics: variables, functions, if/for/while, lists and dicts
- Python 3.10+ installed locally (or access to a cloud notebook)
- A code editor such as VS Code or PyCharm
Curriculum
6 modules · 24 lessons
Module 1Modern Python essentials4 lessons
Module 1
Modern Python essentials
- 01.01Setting up Python 3.10+ and venv
- 01.02f-strings, unpacking and walrus
- 01.03Type hints and mypy basics
- 01.04Reading tracebacks like a pro
Module quiz · 3 questions
Module 2Data structures & comprehensions4 lessons
Module 2
Data structures & comprehensions
- 02.01List, dict and set comprehensions
- 02.02Tuples, namedtuples and dataclasses
- 02.03Generators and lazy iteration
- 02.04collections and itertools you actually use
Module quiz · 3 questions
Module 3Functions, decorators and closures4 lessons
Module 3
Functions, decorators and closures
- 03.01*args, **kwargs and keyword-only args
- 03.02Closures and late binding
- 03.03Writing your first decorator
- 03.04functools: lru_cache, partial, wraps
Module quiz · 3 questions
Module 4OOP and protocols4 lessons
Module 4
OOP and protocols
- 04.01Classes, dunder methods and __repr__
- 04.02Inheritance vs composition
- 04.03Protocols and duck typing
- 04.04ABCs and when to use them
Module quiz · 3 questions
Module 5IO, errors and async4 lessons
Module 5
IO, errors and async
- 05.01Context managers and the with statement
- 05.02Exceptions, custom errors and re-raising
- 05.03async / await fundamentals
- 05.04asyncio.gather and running tasks concurrently
Module quiz · 3 questions
Module 6Projects, tests and tooling4 lessons
Module 6
Projects, tests and tooling
- 06.01Packages, __init__.py and imports
- 06.02uv / pip and pinning dependencies
- 06.03Testing with pytest and fixtures
- 06.04Capstone: refactor a script into a package
Module quiz · 3 questions