Set operations : Set : Collections PYTHON TUTORIALS


PYTHON TUTORIALS » Collections » Set »

 

Set operations


a = set([123])
b = set([234])
print a.union(b)
print a | b
set([1234])
c = a & b
print c.issubset(a)
print c <= a
print c.issuperset(a)
print c >= a
print a.intersection(b)
print set([23])
print a & b
print a.difference(b)
print a - b
print a.symmetric_difference(b)
print a ^ b
print a.copy()
print a.copy() is a



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Collections
» Set