6. Dictionaries and Sets

Objectives

In this chapter, you’ll:

Image Use dictionaries to represent unordered collections of key–value pairs.

Image Use sets to represent unordered collections of unique values.

Image Create, initialize and refer to elements of dictionaries and sets.

Image Iterate through a dictionary’s keys, values and key–value pairs.

Add, remove and update ...

Get Python for Programmers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.