Table of Contents
1. Overview
The symmetric_difference_update() method finds the symmetric difference of two sets and updates the set calling it.
The symmetric difference of two sets A and B is the set of elements that are in either A or B, but not in their intersection.

The syntax of symmetric_difference_update() is:
A.symmetric_difference_update(B)
2. Return Value from symmetric_difference_update()
- The
symmetric_difference_update()returnsNone(returns nothing). Rather, it updates the set calling it.
3. Example: Working of symmetric_difference_update()
A = {'a', 'c', 'd'}
B = {'c', 'd', 'e' }
result = A.symmetric_difference_update(B)
print('A =', A)
print('B =', B)
print('result =', result)
Output
A = {'a', 'e'}
B = {'d', 'c', 'e'}
result = None
Here, the set A is updated with the symmetric difference of set A and B. However, the set B is unchanged.
Recommended Reading: Python Set symmetric_difference()
Related posts:
Machine Learning Mastery with Python - Understand your data, create accurate models and work project...
Python Program to Convert Two Lists Into a Dictionary
Python Program to Find the Factorial of a Number
Python sum()
Python Program to Swap Two Variables
Python String isspace()
Python String translate()
Python Set issubset()
Python if...else Statement
Python classmethod()
Building Chatbots with Python Using Natural Language Processing and Machine Learning - Sumit Raj
Python Program to Randomly Select an Element From the List
Python Data Analytics with Pandas, NumPy and Matplotlib - Fabio Nelli
Python reversed()
Python any()
Python Dictionary setdefault()
Python String splitlines()
Python Deeper Insights into Machine Learning - Sebastian Raschka & David Julian & John Hearty
Python List Comprehension
Python del Statement
Applied Text Analysis with Python - Benjamin Benfort & Rebecca Bibro & Tony Ojeda
Python Set clear()
Machine Learning with Python for everyone - Mark E.Fenner
Python List reverse()
Python ascii()
Python List remove()
Python List insert()
Python Program to Slice Lists
Python bytearray()
Python Program to Check if a Number is Positive, Negative or 0
Python chr()
Python Numbers, Type Conversion and Mathematics