Created
February 24, 2015 13:35
-
-
Save drvinceknight/8042c1d0648d5e7f3223 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
import difflib | |
usr_input = 'Vodca' | |
drinks = ['Jargerbomb', 'Vodka', 'Rum and Coke'] | |
best_match = max(drinks, key=lambda x: difflib.SequenceMatcher(None, usr_input, x).ratio()) | |
print best_match |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment