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:
Python type()
Python List remove()
Python RegEx
Python Multiple Inheritance
Python Program to Make a Flattened List from Nested List
Python List sort()
Python String encode()
Python String title()
Python bool()
Python Program to Catch Multiple Exceptions in One Line
Python Program to Check if a Key is Already Present in a Dictionary
Python Matrices and NumPy Arrays
Python Set difference()
Python slice()
Python Program to Check If Two Strings are Anagram
Python getattr()
Python Set symmetric_difference()
Python String format()
Python String splitlines()
Python chr()
Python Package
Python Program to Represent enum
Python Custom Exceptions
Python String rjust()
Python String join()
Python Program to Find Numbers Divisible by Another Number
Python any()
Python Directory and Files Management
Python property()
Python Anonymous / Lambda Function
Python Program to Find the Factorial of a Number
Python complex()