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 Artificial Intelligence Project for Beginners - Joshua Eckroth
Python String isalpha()
Python Machine Learning Cookbook - Practical solutions from preprocessing to Deep Learning - Chris A...
Python Program to Split a List Into Evenly Sized Chunks
Python all()
Python if...else Statement
Python Program to Add Two Numbers
Python Modules
Python String isdigit()
Python Program to Remove Punctuations From a String
Python dict()
Python Program to Find the Factorial of a Number
Python RegEx
Python divmod()
Python Global Keyword
Python Program to Check if a Key is Already Present in a Dictionary
Python Program to Generate a Random Number
Python next()
Python List count()
Python Numbers, Type Conversion and Mathematics
Python Program to Randomly Select an Element From the List
Python Iterators
Python String rstrip()
Python Program to Display Calendar
Python round()
Python Set difference()
Python Deep Learning - Valentino Zocca & Gianmario Spacagna & Daniel Slater & Peter Roelants
Python slice()
Python Program to Find Sum of Natural Numbers Using Recursion
Natural Language Processing with Python - Steven Bird & Ewan Klein & Edward Loper
Python frozenset()
Python del Statement