I have this hash table and i want to know how to add a value to its values if the keys are the same. with what ive tried ive gotten a cannot find reference append in None
Heres how the table looks:
self._example = [['hello',[1,2,3]],['world',[4,5,6]], [random,[7,8,9]]]
here is the code ive tried:
def add(self,key,value):
i = self._hash(key)
if self._example[i] != None:
while true:
if self._example[i][0] == key:
self._example[i][1].append(value)
break