#!/usr/bin/env python
# coding: utf-8
# # Sequence Matcher in Python
# In[3]:
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
# In[ ]:
0 Comments:
Post a Comment