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 Access Index of a List Using for Loop
Python String splitlines()
Python id()
Python datetime
Python int()
Python String title()
Python String isidentifier()
Python String capitalize()
Python Program to Convert Bytes to a String
Python Program to Display Fibonacci Sequence Using Recursion
Python String lstrip()
Python pow()
Python Program to Find All File with .txt Extension Present Inside a Directory
Python Object Oriented Programming
Python locals()
Python repr()
Python Exception Handling Using try, except and finally statement
Python all()
Building Machine Learning Systems with Python - Willi Richert & Luis Pedro Coelho
Python chr()
Python Dictionary setdefault()
Python String maketrans()
Python Program to Find LCM
Python timestamp to datetime and vice-versa
Introduction to Machine Learning with Python - Andreas C.Muller & Sarah Guido
Python Program to Print all Prime Numbers in an Interval
Python Program to Convert Celsius To Fahrenheit
Python setattr()
Python Numbers, Type Conversion and Mathematics
Python Matrices and NumPy Arrays
Python List append()
Python Program to Merge Mails