Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions website/content/03_sets_tuples_dicts/20_sets.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ date = 2020-08-29T16:54:39-07:00
weight = 20
+++

A `set` is a mutable datatype that allows you to store **immutable** types in an **unsorted** way. Sets are mutable because you can add and remove items from them. They can contain immmutable items, like `tuple`s and other primitive types, but not `list`s, `set`s, or `dict`ionaries which are themselves mutable.
A `set` is a mutable datatype that allows you to store **immutable** types in an **unsorted** way. Sets are mutable because you can add and remove items from them. They can contain immutable items, like `tuple`s and other primitive types, but not `list`s, `set`s, or `dict`ionaries which are themselves mutable.

Unlike a list or a tuple, a set can only contain one instance of a unique item. There are no duplicates allowed.

Expand Down Expand Up @@ -229,4 +229,4 @@ Next, let's find the intersection. We'll create a new `set` with *only* the item

There are other useful operations available on `set`s, such as checking if one set is a subset, a superset, differences, and more, but I don't have time to cover them all. Python also has a `frozenset` type, if you need the functionality of a `set` in an immutable package (meaning that the contents can't be changed after creation).

Find out more by reading the [documentation](https://docs.python.org/3/library/stdtypes.html#set), or calling `help()` on `set`.
Find out more by reading the [documentation](https://docs.python.org/3/library/stdtypes.html#set), or calling `help()` on `set`.