Python – Set add() Method
The Python set add() method adds an item to a set.
The Python set difference() method returns a set that contains the difference between two sets.
The Python set difference_update() method removes the items that exist in both sets.
The Python set discard() method removes the specified item from the set.
The Python set intersection() method returns a set that contains only items that exist in both sets, or in all sets if more than two sets are compared.
The Python set intersection_update() method removes the items that are not present in both sets, or in all sets if more than two sets are compared.
The Python set isdisjoint() method returns True if none of the items are present in both sets, otherwise it returns False.
The Python set issubset() method returns True if all items in the set exists in the specified set, otherwise it returns False.
The Python set issuperset() method returns True if all items in the specified set exists in the original set, otherwise it returns False.
The Python set remove() method removes the specified element from the set.
The Python set symmetric_difference() method returns a set that contains all items from both sets, but not the items that are present in both sets.
The Python set symmetric_difference_update() method updates the original set by removing items that are present in both sets, and inserting other items.
The Python set union() method returns a set that contains all items from the original set, and all items from the specified set(s).
The Python set update() method updates the current set by adding items from another set or sets (or any other iterable).