Step-by-Step Explanation:
-
x = set([1, 2, 3])
Creates a set x with elements: {1, 2, 3} -
y = set([3, 4, 5])
Creates a set y with elements: {3, 4, 5} -
x.symmetric_difference_update(y)
This updates x with the symmetric difference of x and y.
Symmetric difference means:-
Elements in x or y but not both.
Let's find that:
(We exclude the common element 3.)
-
-
So, x is now updated to {1, 2, 4, 5}
✅ Output:
(The order might vary because sets are unordered.)




.png)


.png)





.png)
.png)
