Programmer's Wiki

a Set is a collection where there are no duplicated items and the order of the items does not matter. A Set is a special case of the List Data type.


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[]

External links[]

  • set on math wiki