sets and maps class is implemented to beginhashset objects will contain list and the number of items in the list initially the list will contain bunch of none values the list must be built with some kind of value in it none serves as null value for places in the list where no value has been stored the list isn' nearly big enough to have location for every possible hash value yetthe list can' possibly be big enough for all possible hash values anyway in factas we saw in the last sectionsome hash values are negative and clearly indices into list are not negative the conversion of hash value to list index is explained in more detail in sect the hashset constructor is given in sect the hashset constructor class hashsetdef __init__(self,contents=[])self items [none self numitems for item in contentsself add(item storing an item to store an item in hash set we first compute its index using the hash function there are two problems that must be dealt with firstthe list that items are stored in must be finite in length and definitely cannot be as long as the unique hash values we would generate by calling the hash function since the list must be shorter than the maximum hash valuewe pick size for our list and then divide hash values by the length of this list the remainder ( the result of the operatorcalled the mod operatoris used as the index into the list the remainder after dividing by the length of the list will always be between and the length of the list minus one even if the hash value is negative integer using the mod operator will give us valid indices into list of whatever size we choose there is another problem we must deal with hash values are not necessarily unique hash values are integers and there are only finitely many integers possible in computer in additionbecause we divide hash values by the length of the listthe remaindersor list indiceswill be even less unique than the original hash values if the list length is then hash value of and - will both result in trying to store value at index in the list this isn' possible of course collision resolution consider trying to store both "cowand "foxusing hashing in list whose length is the hash value of "cowis - and the hash value of "foxis when we mod both values by the remainder is for both hash values indicating they should both be stored at the fifth location in list this copy belongs to 'acha