Python Set Methods
Python Set is an unordered collection of items.
Set provides many methods to work on the items in it. Following is the list of tutorials on Set class methods and operations loaded with examples.
- len(set) – Finds the number of items in set.
- item in set – Check if item is present in set.
- item not in set – Check if item is not present in set.
- Python Set – issubset(other) – Check if this set is subset of other set.
- Python Set – issuperset(other) – Check if this set is super set of other set.
- Python Set – union(other) – Find the union of this set and other set.
- Python Set – intersection(other) – Find the set of element present in both this set and other set.
- Python Set – difference(other) – Find set of elements present in this set, but not in other set.
- Python Set – symmetric_difference(other)
- Python Set – copy()
- Python Set – update()
- Python Set – intersection_update()
- Python Set – difference_update()
- Python Set – symmetric_difference_update()
- Python Set – add()
- Python Set – remove()
- Python Set – discard()
- Python Set – pop()
- Python Set – clear()