Python Set Methods

add()Adds an element to the set
clear()Removes all elements from the set
copy()Returns a shallow copy of the set
difference()Returns the difference between two or more sets
difference_update()Removes elements in the set that are in another set
discard()Removes a specified element from the set
intersection()Returns the intersection of two or more sets
intersection_update()Updates the set with the intersection of another set
isdisjoint()Checks if two sets have no elements in common
issubset()Checks if the set is a subset of another set
issuperset()Checks if the set is a superset of another set
pop()Removes and returns an arbitrary element from the set
remove()Removes a specified element from the set
symmetric_difference()Returns the symmetric difference of two sets
symmetric_difference_update()Updates the set with the symmetric difference of another set
union()Returns the union of two or more sets
update()Updates the set with elements from another set