- Set literals are enclosed in braces.
- Duplicate element are removed on construction.
- Sets have arbitrary.
- Checking whether an element is in the set is a constant time operation.
- Methods:
unionintersectionThey do not change the set but create new sets.- add
- remove
- Sets are mutable but the element of set should be hashable, which means it should be immutable.