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 Tuple
Python Program to Display Fibonacci Sequence Using Recursion
Python Program to Check If Two Strings are Anagram
Python if...else Statement
Python Program to Calculate the Area of a Triangle
Java Program to Implement the Binary Counting Method to Generate Subsets of a Set
Python List index()
Python property()
Python Program to Check Prime Number
Python Set difference()
Python String istitle()
Python String rstrip()
Python Program to Count the Occurrence of an Item in a List
Python Program to Sort a Dictionary by Value
Python Closures
Python issubclass()
Python Multiple Inheritance
Python String find()
Python Type Conversion and Type Casting
Python Program to Shuffle Deck of Cards
Python Set pop()
Python Dictionary values()
How to get current date and time in Python?
Python tuple()
Python Program to Sort Words in Alphabetic Order
Node.js vs Python for Backend Development
Python String isalpha()
Python Package
Python memoryview()
Python Program to Print Colored Text to the Terminal
Python Set intersection()