such as lists and dictionaries that are outside the scope of this for examplesets are iterablecan grow and shrink on demandand may contain variety of object types as we'll seea set acts much like the keys of valueless dictionarybut it supports extra operations howeverbecause sets are unordered and do not map keys to valuesthey are neither sequence nor mapping typesthey are type category unto themselves moreoverbecause sets are fundamentally mathematical in nature (and for many readersmay seem more academic and be used much less often than more pervasive objects like dictionaries)we'll explore the basic utility of python' set objects here set basics in python and earlier there are few ways to make sets todaydepending on which python you use since this book covers alllet' begin with the case for and earlierwhich also is available (and sometimes still requiredin later pythonswe'll refine this for and extensions in moment to make set objectpass in sequence or other iterable object to the built-in set functionx set('abcde' set('bdxyz'you get back set objectwhich contains all the items in the object passed in (notice that sets do not have positional orderingand so are not sequences--their order is arbitrary and may vary per python release) set([' '' '' '' '' ']pythons < display format sets made this way support the common mathematical set operations with expression operators note that we can' perform the following operations on plain sequences like stringslistsand tuples--we must create sets from them by passing them to set in order to apply these toolsx set([' '' '' ']difference set([' '' '' '' '' '' '' '' ']union set([' '' ']intersection set([' '' '' '' '' '' ']symmetric difference (xorx yx (falsefalsesupersetsubset the notable exception to this rule is the in set membership test--this expression is also defined to work on all other collection typeswhere it also performs membership (or numeric types