Definition:
If you have data from set1 and want only those values that are not present in set2, you should perform a Difference Operation.
It creates a set that includes only the values from set1.
Syntax:
result = set1 - set2
# or
result = set1.difference(set2)
Example:
a = {1, 2, 3}
b = {2, 3, 4}
result = a - b
print(result)
Output:
Exercise
Perform difference operation on sets a = {10, 20, 30} and b = {20, 40} using Python.
