Ref Set Symmetric_Difference_Update
# Python3.x Python Set symmetric_difference_update() Method
[ Python Sets](#)
* * *
## Description
The `symmetric_difference_update()` method removes elements from the current set that are also present in another specified set, and inserts elements from the other specified set that are not present in the current set.
## Syntax
The syntax for the `symmetric_difference_update()` method is:
set.symmetric_difference_update(set)
## Parameters
* set -- The set to check against.
## Return Value
None.
## Example
Remove duplicate elements from the original set `x` that are present in set `y`, and insert the non-duplicate elements into set `x`:
## Example 1
x = {"apple", "banana", "cherry"} y = {"google", "", "apple"} x.symmetric_difference_update(y)print(x)
The output result is:
{'google', 'cherry', 'banana', ''}
[ Python Sets](#)
[](#)(#)
(#)[](#)
YouTip