by using the ord(functionwe can get the ordinal value of any character for examplethe ord(' 'function gives to get the hash of the whole stringwe could just sum the ordinal numbers of each character in the stringsum(map(ord'hello world') this works fine howevernote that we could change the order of the characters in the string and get the same hashsum(map(ord'world hello') and the sum of the ordinal values of the characters would be the same for the string gello xorld as wellsince has an ordinal value which is one less than that of hand has an ordinal value that is one greater than that of whencesum(map(ord'gello xorld') perfect hashing functions perfect hashing function is one in which each string (as we are limiting the discussion to strings for nowis guaranteed to be unique in practicehashing functions normally need to be very fastso trying to create function that will give each string unique hash value is normally not possible insteadwe live with the fact that we sometimes get collisions (two or more strings having the same hash value)and when that happenswe come up with strategy for resolving them