Last active
April 2, 2020 12:01
-
-
Save ChaitanyaBaweja/aa161ca4611eeb99a7d000c396d37f75 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from difflib import SequenceMatcher # import | |
# creating a SequenceMatcher object comparing two strings | |
check = SequenceMatcher(None, 'chinna', 'china') | |
# printing a similarity ratio on a scale of 0(lowest) to 1(highest) | |
print(check.ratio()) | |
# Output | |
# 0.9090909090909091 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment