the set and frozenset classes python' set class represents the mathematical notion of setnamely collection of elementswithout duplicatesand without an inherent order to those elements the major advantage of using setas opposed to listis that it has highly optimized method for checking whether specific element is contained in the set this is based on data structure known as hash table (which will be the primary topic of howeverthere are two important restrictions due to the algorithmic underpinnings the first is that the set does not maintain the elements in any particular order the second is that only instances of immutable types can be added to python set thereforeobjects such as integersfloating-point numbersand character strings are eligible to be elements of set it is possible to maintain set of tuplesbut not set of lists or set of setsas lists and sets are mutable the frozenset class is an immutable form of the set typeso it is legal to have set of frozensets python uses curly braces and as delimiters for setfor exampleas { or red green blue the exception to this rule is that does not represent an empty setfor historical reasonsit represents an empty dictionary (see next paragraphinsteadthe constructor syntax setproduces an empty set if an iterable parameter is sent to the constructorthen the set of distinct elements is produced for examplesethello produces the dict class python' dict class represents dictionaryor mappingfrom set of distinct keys to associated values for examplea dictionary might map from unique student id numbersto larger student records (such as the student' nameaddressand course gradespython implements dict using an almost identical approach to that of setbut with storage of the associated values dictionary literal also uses curly bracesand because dictionaries were introduced in python prior to setsthe literal form produces an empty dictionary nonempty dictionary is expressed using comma-separated series of key:value pairs for examplethe dictionary ga irish de german maps ga to irish and de to german the constructor for the dict class accepts an existing mapping as parameterin which case it creates new dictionary with identical associations as the existing one alternativelythe constructor accepts sequence of key-value pairs as parameteras in dict(pairswith pairs [ga irish )de german )