symmetric_difference_update() in Python
symmetric_difference_update() in Python
Blog Article
https://docs.vultr.com/python/standard-library/set/symmetric_difference
symmetric_difference_update() in Python
The symmetric_difference_update() method in Python is used with sets to update a set by keeping only the elements that are unique to either of the two sets (i.e., removing common elements). It modifies the original set in place.set1.symmetric_difference_update(set2)
This method removes all elements that are common in set1 and set2.
It keeps only the elements that are unique to each set.