Python Language Intro (Part 3)

Agenda

  1. Language overview
  2. White space sensitivity
  3. Basic Types and Operations
  4. Statements & Control Structures
  5. Functions
  6. OOP (Classes, Methods, etc.)
  7. Immutable Sequence Types (Strings, Ranges, Tuples)
  8. Mutable data structures: Lists, Sets, Dictionaries

8. Mutable data structures: Lists, Sets, Dicts

Lists

This list supports the mutable sequence operations in addition to the common sequence operations.

Mutable list operations

List comprehensions

Sets

A set is a data structure that represents an unordered collection of unique objects (like the mathematical set).

Dictionaries (AKA Maps or HashTables)

A dictionary is a data structure that contains a set of unique key → value mappings.

Dictionary comprehensions

Demo