As the name suggests, the 'symmetric_difference_update( )' Function takes those values that are not present in both the sets.
x = {"Mohan", "Kriti", "Salim"} y = {"Sia", "Andrew", "Kriti"} x.symmetric_difference_update(y) print(x)
So, in the above code we have created a 'Set' and initialised to the variable 'x'.
Then what we have done is, put the names, 'Sia', 'Andrew' and 'Kriti' in another set 'y'.
And used the 'symmetric_difference_update( )' Function next.
And since, 'Kriti' is present in both the Sets, only 'Kriti' would be excluded in the Set 'x'.Rest of the values would be taken.
And we get the below output,