in the meantimewe can at least come up with way to avoid some of the collisions we couldfor exampleadd multiplierso that the hash value for each character becomes the multiplier valuemultiplied by the ordinal value of the character the multiplier then increases as we progress through the string this is shown in the following functiondef myhash( )mult hv for ch in shv +mult ord(chmult + return hv we can test this function on the strings that we used earlierfor item in ('hello world''world hello''gello xorld')print("{}{}format(itemmyhash(item))running the programwe get the following outputpython hashtest py hello world world hello gello xorld note that the last row is the result of multiplying the values in rows and such that equals as an example this time we get different hash values for our strings of coursethis doesn' mean that we have perfect hash let us try the strings ad and gapython hashtest py ad ga