x.union(y) This method returns all the unique items that are present in the two sets, as a new set. x_set | y_set x.intersection(y) This method returns the common items that are present in two sets, as a new set. x_set & y_set difference_update () This method removes all the elements of 'set 2' common to 'set 1' in 'set1'. It updates 'set 1'. x.isdisjoint(y) This method returns True if two sets have null intersection. y.issubset(x) This method returns True for 'Set 2', if all the elements of 'Set 2' are present in 'Set 1' x.issuperset(y) This method returns True for 'Set 1' if all the elements of Set 2 are present in 'Set 1'. x.add(e) It adds a single item to the set and updates the set. x.discard(e) It removes a single item from the set and updates it. x.pop () It pops and returns any arbitrary item from the set. x.copy () It creates a shallow copy of any set. x.clear() It clears all the items of the set.
len (x_dict)To know the number of key: value pairs in the dictionary.x_dict.keys ( )Returns all the 'keys' of dictionariesx_dict.values ( )Returns all the 'values' of dictionariesThe del statementIt is used for deleting any keys from the dictionary.x_dict.pop (key)It will pop a 'value' of the required key.sorted (x_dict)The dictionary will get sorted by its values.x_dict.clear ()Clears all the content of the dictionary