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 String rfind()
Python Set copy()
Python Set symmetric_difference()
Deep Learning with Python - A Hands-on Introduction - Nikhil Ketkar
Python Set add()
Python Multiple Inheritance
Python Dictionary keys()
Python divmod()
Python Package
Deep Learning with Applications Using Python - Navin Kumar Manaswi
Python Global Keyword
Python Program to Shuffle Deck of Cards
Machine Learning with Python for everyone - Mark E.Fenner
Python strptime()
Python Program to Represent enum
Python Operators
Python frozenset()
Python Set intersection_update()
Python zip()
Python for Programmers with introductory AI case studies - Paul Deitel & Harvey Deitel
Python String casefold()
Python input()
Python Program to Print all Prime Numbers in an Interval
Natural Language Processing with Python - Steven Bird & Ewan Klein & Edward Loper
Python Dictionary
Python String splitlines()
Java Program to Implement the Binary Counting Method to Generate Subsets of a Set
Python Modules
Python String translate()
Python getattr()
Python round()
Python Set intersection()