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 replace()
Python Set remove()
Python Global, Local and Nonlocal variables
Python Get Current time
Python Program to Find the Sum of Natural Numbers
Python String join()
Python globals()
Python String isprintable()
Python Program to Create a Long Multiline String
Python Program to Find Hash of File
Python String isidentifier()
Python Dictionary keys()
Python Set pop()
Python sum()
Python Object Oriented Programming
Python Errors and Built-in Exceptions
Python Program to Display Powers of 2 Using Anonymous Function
Python set()
Deep Learning in Python - LazyProgrammer
Python Program to Find Numbers Divisible by Another Number
Python sleep()
Python Program to Get File Creation and Modification Date
Python Set difference()
Python Program to Count the Number of Digits Present In a Number
Python __import__()
Python exec()
Python Program to Count the Occurrence of an Item in a List
Python Program to Create a Countdown Timer
Python Namespace and Scope
Python ascii()
Python frozenset()
Python getattr()