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 Check if a Number is Odd or Even
Python Program to Solve Quadratic Equation
Python Dictionary pop()
Python Program to Find Sum of Natural Numbers Using Recursion
Python Program to Convert Bytes to a String
Python Program to Slice Lists
Python String isprintable()
Python Dictionary fromkeys()
Python String endswith()
Python String replace()
Python Program to Print Hello world!
Python Program to Randomly Select an Element From the List
Deep Learning with Python - Francois Cholletf
Python String istitle()
Python Program to Calculate the Area of a Triangle
Python filter()
Python Strings
Python Program to Remove Punctuations From a String
Python object()
Python Set union()
Python len()
Node.js vs Python for Backend Development
Python String center()
JavaScript Map and Set
Python Recursion
Python String encode()
Python sum()
Python format()
Python classmethod()
How to Get Started With Python?
Python Program to Merge Mails
Machine Learning Mastery with Python - Understand your data, create accurate models and work project...