The difference() method returns a set that contains the difference between two sets. The returned set contains items that exist only in the first set, and not in both sets.
Enter the below code into the interactive shell and try to execute it to see the results.
clubs =set(["Manchester-United","Arsenal","Chelsea","Manchester-City",])
clubsb = set(["Everton","Manchester-United","Liverpool","Totehnam"])
allcubs = clubs - clubsb
print(allcubs)
When the above code is executed it produces the above result.
{'Chelsea', 'Arsenal', 'Manchester-City'}
Top comments (0)