x = {1, 2, 3, 4, 5, 6} y = {1, 2, 3, 4} z = x.difference(y) # 5, 6
Here is what the above code is Doing:
1. We create a set x with the numbers 1, 2, 3, 4, 5, and 6.
2. We create a set y with the numbers 1, 2, 3, and 4.
3. We use the difference() method to find the difference between x and y.
4. We print the result.