As the name suggests, the 'intersection( )' Function takes the values from both the sets and only value that is common in both Sets are taken and initialised to the third Set.
Since, 'Kriti' is the common value in both the Sets, 'intersection( )' Function would just take the name 'Kriti'.
x = {"Mohan", "Kriti", "Salim"} y = {"Sia", "Andrew", "Kriti"} z = x.intersection(y) print(z)
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 'intersection( )' Function next to take the common value and initialise to the third variable 'z'.
And since, 'Kriti' is present in both the Sets, only 'Kriti' will be present in the new Set 'z'.
And we get the below output,