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 Operator Overloading
Python Program to Check if a Number is Odd or Even
Python String startswith()
Python Set remove()
Python List remove()
Python Program to Find the Largest Among Three Numbers
Python Set union()
Python Variables, Constants and Literals
Python Dictionary popitem()
Python Data Structures and Algorithms - Benjamin Baka
Python Deep Learning Cookbook - Indra den Bakker
Python object()
Python bool()
Python Program to Measure the Elapsed Time in Python
Python vars()
Python reversed()
Python String casefold()
Python ascii()
Python Functions
Python Program to Find Hash of File
Python Data Types
Python Program to Represent enum
Python Program to Compute all the Permutation of the String
Python Object Oriented Programming
Python abs()
Python exec()
How to Get Started With Python?
Python Dictionary
Python Tuple count()
Python Dictionary copy()
Statistical Methods for Machine Learning - Disconver how to Transform data into Knowledge with Pytho...
Python Program to Iterate Through Two Lists in Parallel