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 Program to Represent enum
Python List count()
Learning scikit-learn Machine Learning in Python - Raul Garreta & Guillermo Moncecchi
Python Program to Convert String to Datetime
Python Anonymous / Lambda Function
Python Program to Make a Flattened List from Nested List
Python String strip()
Python String expandtabs()
Python Artificial Intelligence Project for Beginners - Joshua Eckroth
Statistical Methods for Machine Learning - Disconver how to Transform data into Knowledge with Pytho...
Python Program to Concatenate Two Lists
Python locals()
Python Program to Find Factorial of Number Using Recursion
Python sleep()
Python callable()
Python Set isdisjoint()
Python RegEx
Python Program to Check Armstrong Number
Python String endswith()
Python Set intersection()
Python Dictionary values()
Python Directory and Files Management
Python Program to Parse a String to a Float or Int
Introduction to Machine Learning with Python - Andreas C.Muller & Sarah Guido
Python String replace()
Python Keywords and Identifiers
Python String index()
Deep Learning with Python - A Hands-on Introduction - Nikhil Ketkar
Python Program to Get the File Name From the File Path
Python frozenset()
Python set()
Python Program to Iterate Over Dictionaries Using for Loop