SHARE
TWEET

Untitled

a guest May 22nd, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. mainString = str(input("Please enter the main string : "))
  2.  
  3. targetString = str(input("Please enter the target string : "))
  4.  
  5. if mainString[0] == targetString[0] :
  6.     temp1 = 0
  7. else :
  8.     temp1 = 1
  9.  
  10. if mainString[1] == targetString[1] :
  11.     temp2 = 0
  12. else :
  13.     temp2 = 1
  14.  
  15. if mainString[2] == targetString[2] :
  16.     temp3 = 0
  17. else :
  18.     temp3 = 1
  19.  
  20. if mainString[3] == targetString[3] :
  21.     temp4 = 0
  22. else :
  23.     temp4 = 1
  24.  
  25. score = temp1 + temp2 + temp3 + temp4
  26.  
  27. print("String Dissimilarity Score : {} ".format(score))
  28.  
  29. if score >= 2 :
  30.     print("Low Similiarity")
  31. else :
  32.     print("High Similiarity")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top