There are no literal values for sets. A
set value is created by using the
set or frozenset factory
functions. These can be applied to any iterable
container, which includes any sequence, and also includes files.
Note that we provided a six-tuple to
the set function, and we got a
set with the four unique objects. The
set is shown with a
list literal, to remind us that a
set is mutable.
frozenset (iterable)
→ set
Transforms the given iterable (sequence, file or
set) into an immutable
frozenset.
Published under the terms of the Open Publication License