table set methods and operators syntax description add(xadds item to set if it is not already in clear(removes all the items from set copy(returns shallow copy of set difference(ts returns new set that has every item that is in set that is not in set removes every item that is in set from set difference_update(ts - discard(xremoves item from set if it is in ssee also set remove( intersection(ts intersection_update(ts & isdisjoint(ts issubset(ts < issuperset(ts > pop(returns and removes random item from set sor raises keyerror exception if is empty remove(xremoves item from set sor raises keyerror exception if is not in ssee also set discard( symmetric_ difference(ts returns new set that has every item that is in set and every item that is in set tbut excluding items that are in both sets symmetric_ difference_update(ts ^ union(ts makes set contain the symmetric difference of itself and set update(ts | returns new set that has each item that is in both set and set makes set contain the intersection of itself and set returns true if sets and have no items in common returns true if set is equal to or subset of set tuse to test whether is proper subset of returns true if set is equal to or superset of set tuse to test whether is proper superset of returns new set that has all the items in set and all the items in set that are not in set adds every item in set that is not in set sto set this method and its operator (if it has onecan also be used with frozensets shallow and deep copying