2

Hamming Distance is a way to detect text simlarity. However, Hamming Distance only returns an integer. I wonder if it is possible to calculate Hamming Distance out as a percentage. Thanks

My Python code to calculate Hamming Distance

hamming = 0
for i, x in enumerate(FinalString):
    if x != FinalString2[i]:
        hamming += 1
kiwirafe
  • 123

1 Answers1

2

You can certainly divide the Hamming distance by the length of the string and report the result as a percentage.

Ross Millikan
  • 374,822