Skip to content

Python Basics

Beginner · 9 topics · no experience needed

Everything you need before calling your first LLM API. Each topic has commented examples, a why it matters for GenAI tip and a practice task with an answer.

# Topic Sub-topics
1 Getting started Install Python · first script · REPL · virtual environments · editor
2 Variables & data types Variables · int / float · str · bool & None · type conversion
3 Operators & control flow Comparisons · if/elif/else · for · while, break, continue · match
4 Strings f-strings · slicing · methods · split & join · multi-line prompts
5 Data structures Lists · tuples · sets · dictionaries · lists of dicts · comprehensions
6 Functions Defining · default & keyword args · *args / **kwargs · scope · lambda
7 Modules & packages Imports · standard library · your own modules · pip · environment variables
8 Files, JSON & errors Reading/writing files · folders · JSON · try/except · raise
9 Classes & OOP basics Classes & objects · attributes · __repr__ · inheritance

Next: once these feel comfortable, continue with Python Advanced.