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 Program to Append to a File
Python property()
Python List sort()
Python next()
Python Set copy()
Python RegEx
Python enumerate()
Python Program to Find the Factors of a Number
Python Iterators
Python String translate()
Python List clear()
Python Program to Check if a Number is Odd or Even
Python hasattr()
Converting Between a List and a Set in Java
Python Program to Check the File Size
Python *args and **kwargs
Python Program to Print the Fibonacci sequence
Python Variables, Constants and Literals
Python Program to Find Armstrong Number in an Interval
How to Get Started With Python?
Python String isprintable()
Python Program to Convert String to Datetime
Python Program to Access Index of a List Using for Loop
Python filter()
Python Exception Handling Using try, except and finally statement
Python Program to Get the File Name From the File Path
Python String format()
Python iter()
Python Program to Count the Number of Each Vowel
Python Program to Check Prime Number
Introduction to Machine Learning with Python - Andreas C.Muller & Sarah Guido
Python abs()