Sets have their own operations that other collections do not have. These are all methods of creating a new set out of two other sets.
Union - The set of items that are present in either set.
Intersection - The set of items that are present in both sets.
Complement - The set where all items in one set are removed from the other.
using sets in python requires the importing of the set module
Sets can be created with
mySet = Set([1,2,3,4])
the java Set class is java.util.Set
See Also Edit
- set on math wiki