
class HashTable(object):
	def __init__(self):
		self.table = [None]*10000

	def store(self, string):
		hash_value = self.calculate_hash_value(string)
		if hash_value != -1:
			if self.table[hash_value] != None:
				self.table[hash_value].append(string)
			else:
				self.table[hash_value] = [string]

	def search(self, string):
		hash_value = self.calculate_hash_value(string)
		if hash_value != -1:
			if self.table[hash_value] != None:
				if string in self.table[hash_value]:
					return hash_value
		return -1


class HashTable(object):
	def __init__(self):
		self.table = [None]*10000

	def store(self, string):
		hash_value = self.calculate_hash_value(string)
		if hash_value != -1:
			if self.table[hash_value] != None:
				self.table[hash_value].append(string)
			else:
				self.table[hash_value] = [string]

	def search(self, string):
		hash_value = self.calculate_hash_value(string)
		if hash_value != -1:
			if self.table[hash_value] != None:
				if string in self.table[hash_value]:
					return hash_value
		return -1

	def calculate_hash_value(self, string):
		value = ord(string[0])*100 + ord(string[1])
		return value

Add calculate hash value method
Add calculate hash value method

  
  class HashTable(object):
  	def __init__(self):
  		self.table = [None]*10000
  
  	def store(self, string):
  		hash_value = self.calculate_hash_value(string)
  		if hash_value != -1:
  			if self.table[hash_value] != None:
  				self.table[hash_value].append(string)
  			else:
  				self.table[hash_value] = [string]
  
  	def search(self, string):
  		hash_value = self.calculate_hash_value(string)
  		if hash_value != -1:
  			if self.table[hash_value] != None:
  				if string in self.table[hash_value]:
  					return hash_value
  		return -1
  
+ 	def calculate_hash_value(self, string):
+ 		value = ord(string[0])*100 + ord(string[1])
+ 		return value
+ 
Add calculate hash value method
## Code Before:

class HashTable(object):
	def __init__(self):
		self.table = [None]*10000

	def store(self, string):
		hash_value = self.calculate_hash_value(string)
		if hash_value != -1:
			if self.table[hash_value] != None:
				self.table[hash_value].append(string)
			else:
				self.table[hash_value] = [string]

	def search(self, string):
		hash_value = self.calculate_hash_value(string)
		if hash_value != -1:
			if self.table[hash_value] != None:
				if string in self.table[hash_value]:
					return hash_value
		return -1

## Instruction:
Add calculate hash value method
## Code After:

class HashTable(object):
	def __init__(self):
		self.table = [None]*10000

	def store(self, string):
		hash_value = self.calculate_hash_value(string)
		if hash_value != -1:
			if self.table[hash_value] != None:
				self.table[hash_value].append(string)
			else:
				self.table[hash_value] = [string]

	def search(self, string):
		hash_value = self.calculate_hash_value(string)
		if hash_value != -1:
			if self.table[hash_value] != None:
				if string in self.table[hash_value]:
					return hash_value
		return -1

	def calculate_hash_value(self, string):
		value = ord(string[0])*100 + ord(string[1])
		return value
