This method is used to remove the common items from set A and it inserts the unique item from set B. Given that A.symmetric_difference_update(B). Also, this method directly works in original set, therefore original set itself is changed.
This method takes argument.
- Set A is being taken with some random values.
- Set B is being taken with some random values.
- symmetric_difference_update() method is being applied on set A with the help of set B.
- Value of set A is printed
- Value of set B is printed
- Set A has non-common items as well as unique items from set B.
- Set B remains unchanged.
- What is the difference between symmetric_difference() and symmetric_difference update() method?
symmetric_difference() method returns non common items from both the sets in another variable, whereas symmetric_difference_update() method alters the original set with non-common items from both the set.