CHAPTER 14

Tuples, Sets, and Dictionaries

 

Objectives

  • To create tuples (§14.2).
  • To use tuples as fixed lists to prevent elements from being added, deleted, or replaced (§14.2).
  • To apply common sequence operations for tuples (§14.2).
  • To create sets (§14.3.1).
  • To add and remove elements in a set using the add and remove methods (§14.3.2).
  • To use the len, min, max, and sum functions for a set of elements (§14.3.2).
  • To use the in or not in operator to determine whether an element is in a set (§14.3.2).
  • To traverse the elements in a set using a for loop (§14.3.2).
  • To test whether a set is a subset or a superset of another set using the issubset or issuperset method (§14.3.3).
  • To test whether two sets have the same contents using the == operator ...

Get Introduction to Python Programming and Data Structures, 3rd Edition by Pearson 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.