title: Hashing - inserting a value into the hash table
body: <p>Can anyone help me fix my put function which inserts a value into the hash table?
  Right now I'm getting an output of a hash table full of None's
  e.g. [None, None, None, None, None]</p>
  
  <pre><code>class BasicHashTable:
  def __init__(self,size=7):
      self.size = size
      self.slots = [None] * self.size
  
  def hash_function(self, key):
      return key%len(self.slots)
  
  def rehash(self, old_pos):
      return (old_pos + 1) % self.size
  
  def put(self, key):
      hash_value = key%len(self.slots)    
      probe_seq=[]     
      insert_pos=hash_value     
      probe_seq+=[insert_pos]     
      probes=1     
      while(self.slots[insert_pos]!=None):         
          probes+=1         
          insert_pos=(insert_pos+1)%len(self.slots)         
          probe_seq+=[insert_pos]     
          self.slots[insert_pos]=key     
      return insert_pos
  </code></pre>
  
  <p>Testing: </p>
  
  <pre><code>hash_t = BasicHashTable() 
  hash_t.put(3)
  hash_t.put(20)
  hash_t.put(10)
  print(hash_t.slots)
  </code></pre>
  
  <p>Gives [None, None, None, 3, 10, None, 20]</p>