Sets
Table of contents
Description
Sets are a comma-separated collection of elements, enclosed by curly braces.
- Mutable: Their individual elements can be changed.
- Unique: Each element must be unique. Duplicate values will be eliminated automatically.
- Unordered: the elements are stored in no specific order.
- Individual elements cannot be accessed via index numbers or keys.
- There are many comparison-type actions that can be performed on sets.
- Python Docs: Sets, Set Types
Examples
Mutability
Sets are mutable, which means you can change their attributes after instantiation.