from difflib import SequenceMatcher
text1 = input("Enter 1st sentence : ")
text2 = input("Enter 2nd sentence : ")
sequenceScore = SequenceMatcher(None, text1, text2).ratio()
print(f"Both are {sequenceScore * 100} % similar")
#clcoding.com
Enter 1st sentence : I love Python Enter 2nd sentence : Python is easy Both are 44.44444444444444 % similar
0 Comments:
Post a Comment