title: String hashing with quadratic probing, in Python
body: <p>I am trying to write a function in Python, that will add strings to a hash table and resolve any collisions with quadratic probing, without importing math.</p>
  
  <pre><code>def addString(string, hashTable):
      collisions = 0
      stop = False
      slot = (hashString(string, len(hashTable)))
      while not stop:
          if hashTable[slot] == None:
              hashTable[slot] = string
              stop = True
          else:
              slot = slot + (collisions**2)%len(hashTable)
              collisions = collisions + 1
          print('collisions: ', collisions)
  </code></pre>
  
  <p>My problem is that I keep getting IndexError: list index out of range and I am certain the problem lies in the else block however, I can't seem to find a solution for it. Any help appreciated, thanks.</p>