The Python Papers

The Python Papers

Python 101 - Learning About Sets

Mike Driscoll's avatar
Mike Driscoll
Jul 26, 2023
∙ Paid

A set data type is defined as an "unordered collection of distinct hashable objects" according to the Python 3 documentation. You can use a set for membership testing, removing duplicates from a sequence and computing mathematical operations, like intersection, union, difference, and symmetric difference.

Because they are unordered collections, a set doe…

User's avatar

Continue reading this post for free, courtesy of Mike Driscoll.

Or purchase a paid subscription.
© 2025 Mike Driscoll · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture