title: Implement Hash Table using list variables in python
body: <p>I implemented a simple hash table using list variables. Below is my code.</p>
  <pre class="lang-py prettyprint-override"><code>hash_table = list([0 for i in range(8)])
  
  def get_key(data):
      return hash(data)
  
  def hash_function(key):
      return key % 8
  
  def save_data(data, value):
      hash_address = hash_function(get_key(data))
      hash_table[hash_address] = value
      
  def read_data(data):
      hash_address = hash_function(get_key(data))
      return hash_table[hash_address]
  </code></pre>
  <p>After putting some data into the hash table, I found something strange.</p>
  <pre class="lang-py prettyprint-override"><code>save_data('Andy', '01055553333')
  save_data('Dave', '01044443333')
  save_data('Trump', '01022223333')
  
  read_data('Dave')
  </code></pre>
  <p>The above code is to read Dave's value after putting data and value in the hash table.</p>
  <p>And, this is my result.</p>
  <pre class="lang-py prettyprint-override"><code>'01022223333'
  </code></pre>
  <p>But somehow, the result was Trump's value. So, I checked the entire hash table, but I couldn't find Dave's value.</p>
  <pre class="lang-py prettyprint-override"><code>hash_table
  </code></pre>
  <pre class="lang-py prettyprint-override"><code>[0, 0, 0, '01055553333', 0, '01022223333', 0, 0]
  </code></pre>
  <p>I thought this was caused by the size of the hash table. But after increasing the size from 8 to 100, it still doesn't include Dave's value.</p>
  <p>Or, is this problem caused by hash collision?</p>
  <p>I want to know why this happened, and how to fix this problem.</p>