Python for GenAI¶
Every GenAI system — LLM apps, RAG pipelines, agents — is built in Python. The track starts there: solid basics first, then the advanced features real LLM codebases rely on.
-
Python Basics
Setup, data types, control flow, strings, data structures, functions, modules, files & JSON, classes.
Beginner · 9 topics
-
Python Advanced
Generators, decorators, Pydantic, logging, asyncio, concurrency, pytest, project structure, caching.
Intermediate · 10 topics
All topics¶
| # | Topic | Sub-topics |
|---|---|---|
| 1 | Getting started | Install · first script · REPL · virtual environments |
| 2 | Variables & data types | Numbers · strings · booleans & None · conversion |
| 3 | Operators & control flow | if · for · while · match |
| 4 | Strings | f-strings · slicing · methods · split & join |
| 5 | Data structures | Lists · tuples · sets · dicts · comprehensions |
| 6 | Functions | Arguments · *args/**kwargs · scope · lambda |
| 7 | Modules & packages | Imports · standard library · pip · env variables |
| 8 | Files, JSON & errors | Files · folders · JSON · try/except |
| 9 | Classes & OOP basics | Classes · attributes · __repr__ · inheritance |
| # | Topic | Sub-topics |
|---|---|---|
| 1 | Iterators & generators | yield · lazy reading · streaming |
| 2 | Decorators | Closures · wraps · retry · lru_cache |
| 3 | Context managers | with · @contextmanager · suppress |
| 4 | Type hints, dataclasses & Pydantic | Hints · dataclasses · validating JSON |
| 5 | Error handling & logging | Custom errors · raise from · logging |
| 6 | Async programming | await · gather · semaphores · timeouts |
| 7 | Concurrency | GIL · threads · processes |
| 8 | Testing with pytest | Fixtures · parametrize · faking LLMs |
| 9 | Project structure | Layout · settings · pyproject.toml |
| 10 | Performance & caching | Measuring · caches · batching |
Coming next in Notes
LLM fundamentals (tokens, context windows, sampling) · Embeddings & vector search · RAG · Agents & tool calling