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:
Statistical Methods for Machine Learning - Disconver how to Transform data into Knowledge with Pytho...
Python String isalpha()
Python Program to Safely Create a Nested Directory
Python str()
Python Program to Concatenate Two Lists
Python dir()
Python String upper()
Python Program to Multiply Two Matrices
Python Program to Count the Number of Digits Present In a Number
Python Program to Split a List Into Evenly Sized Chunks
Python String rstrip()
Python String rfind()
Python Modules
Python Tuple
Python Program to Add Two Matrices
Python repr()
Python Dictionary fromkeys()
Python for Loop
Python Program to Randomly Select an Element From the List
Python Data Analytics with Pandas, NumPy and Matplotlib - Fabio Nelli
Python List sort()
Python Program to Shuffle Deck of Cards
Python Machine Learning - Sebastian Raschka
Python Program to Measure the Elapsed Time in Python
Python int()
Python Program to Convert Kilometers to Miles
Introduction to Machine Learning with Python - Andreas C.Muller & Sarah Guido
Python id()
Python while Loop
Python Program to Compute all the Permutation of the String
Python Program to Get the File Name From the File Path
Python Dictionary clear()