def __getitem__(self, key):
    return self._values[self._key_to_index[key]]

def __setitem__(self, key, value):
    self._values.append(value)
Simultaneously replacing all values of a dictionary to zero python