We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
##Introduction
###Creation s = set() s = set([1,2,3,3,1])
###Union s1 = set([1, 2, 3]) s2 = set([1, 2, 3, 4, 6, 7])
s1 | s2 => Returns a new set, doesn't modify any of s1 or s2. s1.union(s2) => Returns a new set containing both.
###Intersection s1 & s2 => Returns a new set containing intersection of both the sets s1.intersection(s2)
###difference s1 - s2 => returns elements that is present in s1 & not in s2 s1.difference(s2)
###symmetric_difference s1 ^ s2 => Returns symmetric difference s1.symmetric_difference(s2)
###isdisjoint s1.isdisjoint(s2) => Returns true is none of the elements are in common
###Three types of updates are present in sets -