Software Carpentry
Sets, Dictionaries, and Complexity


Introduction


You Can Skip This Lecture If...


Sets


Set Operations


Set Example


How Set Values Are Stored


Immutability


Frozen Sets


A Note on Language Design


Efficiency


Complexity Curves


Algorithmic Complexity


Motivating Dictionaries


Creating and Indexing


Updating Dictionaries


Membership and Loops


Dictionary Methods


Counting Frequency


A Slight Simplification


Imposing Order


Inverting a Dictionary


Another Way to Do It


Formatting Strings with Dictionaries


Extra Keyword Arguments


Extra Positional Arguments


Summary