Function Details: symmetric_difference_update

Description


Update a set with the symmetric difference of itself and another.


Extended Description


The symmetric_difference_update() method updates the set, keeping only elements found in either the set or the specified iterable, but not in both. It's equivalent to the ^= operator for sets.


Function Signature



Module: set

Class: set

Parameters



Parameter List


  • other: Iterable

Return


This method doesn't return a value. It modifies the set in-place.


Return Type


None

Output

Explanation

This example demonstrates the basic usage of symmetric_difference_update(). The set s1 is modified to contain elements that are in either s1 or s2, but not in both.