Collections in Python

Lessons in this section

  1. Lists

    Creating, indexing and slicing lists, updating and removing items, sorting with sort() and sorted(), shallow against deep copying, and every list method.

  2. Tuples

    Immutable ordered records: the trailing-comma trap, slicing, rebuilding instead of changing, packing and unpacking, and the two tuple methods.

  3. Sets

    Unique unordered values: creating sets, add and discard, union, intersection and difference, the whole method list, and frozen sets.

  4. Dictionary

    Key-value pairs: key rules, get() against square brackets, adding and removing, looping over keys, values and items, and every dictionary method.