(self, key, value)
Sets the key to the value, replacing any existing value.
Sets the key to the value, replacing any existing value.
Sets the key to the value replacing any existing value .
def set(self, key, value):
        """
        Sets the key to the value, replacing any existing value.
        """
        slot = self.hash_key(key)

        if self.dict[slot] != (None, None):
            self.num_collisions += 1  # collision occured

        self.dict[slot] = (key, value)

        if self.keys.__contains__(key):
            self.keys[key] = self.keys[key] + 1
        else:
            self.keys[key] = 1
def set ( self , key , value ) : slot = self . hash_key ( key ) if self . dict [ slot ] != ( None , None ) : self . num_collisions += 1 # collision occured self . dict [ slot ] = ( key , value ) if self . keys . __contains__ ( key ) : self . keys [ key ] = self . keys [ key ] + 1 else : self . keys [ key ] = 1