A data structure is a way of organising many values together. Python’s four core data structures — lists, tuples, sets, and dictionaries — handle almost every shape of data you’ll meet in real work.

This is the most important section in the course for anyone heading toward AI or ML. Spreadsheets, JSON files, model inputs, and dataset rows all map onto these four shapes.

What’s in this section

  1. Lists — ordered, changeable collections (the workhorse of Python)
  2. Tuples — ordered, fixed collections
  3. Sets — unordered collections of unique values
  4. Dictionaries — key/value lookups, the foundation of JSON-style data
  5. List, set, and dict comprehensions — build collections in one line

Each lesson covers how to create, access, change, and loop over the structure, then introduces the methods you’ll use most.

Toggle theme (T)