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 object()
Python String strip()
Python Program to Sort Words in Alphabetic Order
Machine Learning Applications Using Python - Cases studies form Healthcare, Retail, and Finance - Pu...
Python String format_map()
Python String format()
Python Set difference()
Python property()
Python Program to Display Powers of 2 Using Anonymous Function
Building Chatbots with Python Using Natural Language Processing and Machine Learning - Sumit Raj
Python sorted()
Python String partition()
Python String lstrip()
Python Machine Learning Second Edition - Sebastian Raschka & Vahid Mirjalili
Python Set isdisjoint()
Python Strings
Python String count()
Python Program to Find Factorial of Number Using Recursion
Python min()
Python Program to Check If Two Strings are Anagram
Python Variables, Constants and Literals
Python bytearray()
Python round()
Python del Statement
Introduction to Scientific Programming with Python - Joakim Sundnes
Machine Learning Mastery with Python - Understand your data, create accurate models and work project...
Python Program to Delete an Element From a Dictionary
Python Tuple count()
Python Program to Get the Full Path of the Current Working Directory
Python Tuple index()
Python Program to Find All File with .txt Extension Present Inside a Directory
Python tuple()