GH avatar Bite 23. Find words that are > 95% similar

Given a list of tags of our blog find the ones that have a similarity score of over 95%

Don't worry, difflib to the rescue and in particular SequenceMatcher.

Return a list of similar tag pairs (tuples):

[('cheat sheets', 'cheat sheet'), 
 ('webscraping', 'web scraping'),
 ('contextmanagers', 'contextmanager'),
 ...]

See the tests for what your code should pass. Have fun and see you in the next Bite ... by the way: What's your favorite Python module?

Login and get coding
go back Advanced level
Bitecoin 4X

117 out of 121 users completed this Bite.
Will you be Pythonista #118 to crack this Bite?
Resolution time: ~39 min. (avg. submissions of 5-240 min.)
Pythonistas rate this Bite 3.64 on a 1-10 difficulty scale.
» You can do it! 😌

We use Python 3.7