Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mainString = str(input("Please enter the main string : "))
- targetString = str(input("Please enter the target string : "))
- if mainString[0] == targetString[0] :
- temp1 = 0
- else :
- temp1 = 1
- if mainString[1] == targetString[1] :
- temp2 = 0
- else :
- temp2 = 1
- if mainString[2] == targetString[2] :
- temp3 = 0
- else :
- temp3 = 1
- if mainString[3] == targetString[3] :
- temp4 = 0
- else :
- temp4 = 1
- score = temp1 + temp2 + temp3 + temp4
- print("String Dissimilarity Score : {} ".format(score))
- if score >= 2 :
- print("Low Similiarity")
- else :
- print("High Similiarity")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement