Dictionaries and Sets

Learning Objectives

By the end of this chapter, you will be able to:

  • Create and use dictionaries
  • Use methods and attributes associated with dictionaries
  • Describe and use ordered dictionaries to store and retrieve data in a predictable order
  • Create sets, as well as add, read, and remove data from them
  • Describe the attributes defined on set objects
  • Describe frozen sets

This lesson describes dictionaries and sets. We cover creating, reading, and writing data to these data structures.

Introduction

You have already seen lists that hold values that you can access by using indexes. However, what if you wanted to name each value, instead of using an index? For example, suppose that you want to access a list of cake ingredients, ...

Get Python Fundamentals 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.