input: Write a function to implement a hash table in Python that supports insert, delete and retrieve operations. The hash table should be implemented as a class with methods for each operation.
  
  
  class HashTable:
      def __init__(self):
          self.table = [[] for _ in range(256)]
   
      def insert(self, key, value):
          h = hash(key) % 256
          for i, kv in enumerate(self.table[h]):
              if kv[0] == key:
                  self.table[h][i] = (key, value)
                  return
          self.table[h].append((key, value))
   
      def retrieve(self, key):
          h = hash(key) % 256
          for kv in self.table[h]:
              if kv[0] == key:
                  return kv[1]
   
      def delete(self, key):
          h = hash(key) % 256
          for i, kv in enumerate(self.table[h]):
              if kv[0] == key:
                  del self.table[h][i]
  
  # Test cases
  hash_table = HashTable()
  hash_table.insert("key1", "value1")
  hash_table.insert("key2", "value2")
  hash_table.insert("key3", "value3")
  assert hash_table.retrieve("key1") == "value1"
  assert hash_table.retrieve("key2") == "value2"
  assert hash_table.retrieve("key3") == "value3"
  hash_table.delete("key2")
  assert hash_table.retrieve("key2") is None
  assert hash_table.retrieve("key1") == "value1"
  assert hash_table.retrieve("key3") == "value3"
  
output: class HashTable:
      def __init__(self):
          self.table = [[] for _ in range(256)]
   
      def insert(self, key, value):
          h = hash(key) % 256
          for i, kv in enumerate(self.table[h]):
              if kv[0] == key:
                  self.table[h][i] = (key, value)
                  return
          self.table[h].append((key, value))
   
      def retrieve(self, key):
          h = hash(key) % 256
          for kv in self.table[h]:
              if kv[0] == key:
                  return kv[1]
   
      def delete(self, key):
          h = hash(key) % 256
          for i, kv in enumerate(self.table[h]):
              if kv[0] == key:
                  del self.table[h][i]