Definition
The symmetric_difference_update() method updates the original set by removing items that are present in both sets, and inserting the other items.
Syntax
set.symmetric_difference_update(set)
Parameters
Parameter | Description |
---|---|
set | Required. The set to check for matches in |
Examples:
persons1 = {"Mark", "Jeff", "Ivan", "Mike"}
persons2 = {"Arnel", "Marie", "Ivan", "Alex"}
persons1.symmetric_difference_update(persons2)
print(persons1)