Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Play With Set (new Python 2.4 Module)

DZone's Guide to

Play With Set (new Python 2.4 Module)

·
Free Resource

a = set("ABC")
b = set("CDE")

print "A:",a
print "B:",b
print "Intersection:\t",a & b
print "Union:\t\t",a | b
print "Diff a-b:\t\t",a - b
print "Diff b-a:\t\t",b - a
print "Exclusive:\t\t",a ^ b
Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}