symmetric_difference() - Returns a set with the symmetric differences of two sets

Returns a set that contains all the items from both sets except items that are present in both sets.

Example

Python
desktopComponents = {'memory', 'processor', 'hard drive'}
laptopComponents = {'memory', 'processor', 'SSD', 'camera', 'keyboard'}
difference = desktopComponents.symmetric_difference(laptopComponents)
print(difference)

Output

{'keyboard', 'camera', 'hard drive', 'SSD'}