Use this function to create a set value. Here
is the general form:
set(S)
The optional argument is any iterable;
the return value is a new Sset instance
containing the unique values from . When called with no arguments,
this function returns a new, empty set. Examples:
S
>>> empty = set() >>> empty set([]) >>> len(empty) 0 >>> swallows=set(['African', 'European']) >>> swallows set(['European', 'African']) >>> len(swallows) 2 >>> set ( (0, 0, 0, 58, 0, 0, 58, 17) ) set([0, 17, 58])
For more information about sets, see Section 15, “Types set and frozenset:
Set types”.