I’m struggling with the logic in the HashTable class for the optional question. For the get_valid_index function i’m using the built in has function and passing in key as the argument and finding the remainder of the length of the data list variable set from the constructor method. Am I using the implementation of the built in hash function and linear probing correctly with the get_valid_index function? The two cells after return False and they are supposed to return True, but the 3rd cell returns True so I’m confused.

```
MAX_HASH_TABLE_SIZE = 4096
class HashTable:
def __init__(self, max_size=MAX_HASH_TABLE_SIZE):
self.data_list = [None] * max_size
def get_valid_index(self, key):
# Use Python's in-built `hash` function and implement linear probing
idx = hash(key) % len(self.data_list)
def __getitem__(self, key):
# Implement the logic for "find" here
idx = get_valid_index(self.data_list, key) # find index for key
kv = self.data_list[idx] # retreive key value(kv) stored at index
def __setitem__(self, key, value):
# Implement the logic for "insert/update" here
idx = get_valid_index(self.data_list, key) #find index for key
self.data_list[idx] = key, value #store key-value pair at correct index
def __iter__(self):
return (x for x in self.data_list if x is not None)
def __len__(self):
return len([x for x in self])
def __repr__(self):
from textwrap import indent
pairs = [indent("{} : {}".format(repr(kv[0]), repr(kv[1])), ' ') for kv in self]
return "{\n" + "{}".format(',\n'.join(pairs)) + "\n}"
def __str__(self):
return repr(self)
```